org.dllearner.utilities.owl
Class ConceptComparator

java.lang.Object
  extended by org.dllearner.utilities.owl.ConceptComparator
All Implemented Interfaces:
Comparator<Description>

public class ConceptComparator
extends Object
implements Comparator<Description>

Implements a total order on class descriptions. Note that the comparator is, of course, inconsistent with equals on class descriptions, because currently two class descriptions are considered equal if they refer to the same memory address (Java standard), while this comparator takes the syntax of class descriptions into account. TODO Improve implementation (better not to rely on number of children, make better use of the class hierarchy to avoid too many instanceof operations e.g. boolean description [union, intersection, negation], restrictions [card., quantor], classes [top, named, bottom] could be the first decision criterion). TODO Add a description how exactly the order is defined.

Author:
Jens Lehmann

Constructor Summary
ConceptComparator()
           
ConceptComparator(Set<NamedClass> atomicConcepts)
           
 
Method Summary
 int compare(Description concept1, Description concept2)
           
 boolean equals(Object o)
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConceptComparator

public ConceptComparator()

ConceptComparator

public ConceptComparator(Set<NamedClass> atomicConcepts)
Method Detail

compare

public int compare(Description concept1,
                   Description concept2)
Specified by:
compare in interface Comparator<Description>

equals

public boolean equals(Object o)
Specified by:
equals in interface Comparator<Description>
Overrides:
equals in class Object


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann