コード例 #1
0
 @SuppressWarnings("unchecked")
 @Override
 public boolean equals(Object obj) {
   if (super.equals(obj)) {
     if (!(obj instanceof OWLCardinalityRestriction)) {
       return false;
     }
     OWLCardinalityRestriction<R, P, F> other = (OWLCardinalityRestriction<R, P, F>) obj;
     return other.getCardinality() == cardinality && other.getFiller().equals(filler);
   }
   return false;
 }
コード例 #2
0
 @SuppressWarnings("unchecked")
 @Override
 protected int compareObjectOfSameType(OWLObject object) {
   OWLCardinalityRestriction<R, P, F> other = (OWLCardinalityRestriction<R, P, F>) object;
   int diff = getProperty().compareTo(other.getProperty());
   if (diff != 0) {
     return diff;
   }
   diff = getCardinality() - other.getCardinality();
   if (diff != 0) {
     return diff;
   }
   return getFiller().compareTo(other.getFiller());
 }