@Override
 protected int compareObjectOfSameType(OWLObject object) {
   OWLDatatypeRestriction other = (OWLDatatypeRestriction) object;
   int diff = datatype.compareTo(other.getDatatype());
   if (diff != 0) {
     return diff;
   }
   return compareSets(facetRestrictions, other.getFacetRestrictions());
 }
 @Override
 public void visit(OWLDatatypeRestriction node) {
   write("DatatypeRestriction");
   node.getDatatype().accept(this);
   for (OWLFacetRestriction r : node.getFacetRestrictions()) {
     writeSpace();
     r.accept(this);
   }
 }
 @Override
 public void visit(OWLDatatypeRestriction node) {
   node.getDatatype().accept(this);
   OWLDatatype dr = (OWLDatatype) obj;
   Set<OWLFacetRestriction> restrictions = new HashSet<OWLFacetRestriction>();
   for (OWLFacetRestriction restriction : node.getFacetRestrictions()) {
     restriction.accept(this);
     restrictions.add((OWLFacetRestriction) obj);
   }
   obj = dataFactory.getOWLDatatypeRestriction(dr, restrictions);
 }
 @Override
 public boolean equals(Object obj) {
   if (super.equals(obj)) {
     if (!(obj instanceof OWLDatatypeRestriction)) {
       return false;
     }
     OWLDatatypeRestriction other = (OWLDatatypeRestriction) obj;
     return other.getDatatype().equals(datatype)
         && other.getFacetRestrictions().equals(facetRestrictions);
   }
   return false;
 }
 @Override
 public void visit(OWLDatatypeRestriction node) {
   handleObject(node);
   node.getDatatype().accept(this);
   process(node.getFacetRestrictions());
 }
 public void visit(OWLDatatypeRestriction node) {
   node.getDatatype().accept(this);
   for (OWLFacetRestriction facetRestriction : node.getFacetRestrictions()) {
     facetRestriction.accept(this);
   }
 }