Package net.ontopia.topicmaps.utils
Class TypedIFComparator
java.lang.Object
net.ontopia.topicmaps.utils.TypedIFComparator
- All Implemented Interfaces:
Comparator<TypedIF>
INTERNAL: Comparator that grabs the type of the comparable objects
using TypedIF.getType() , and passes those two topics to it's
subcomparator. Note that this comparator may only be used with
objects that implement TypedIF.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Comparator<TopicIF>INTERNAL: The comparator used to compare the types -
Constructor Summary
ConstructorsConstructorDescriptionTypedIFComparator(Comparator<TopicIF> subcomparator) INTERNAL: Creates a TypedIfComparator which uses the given comparator -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
subcomparator
INTERNAL: The comparator used to compare the types
-
-
Constructor Details
-
TypedIFComparator
INTERNAL: Creates a TypedIfComparator which uses the given comparator- Parameters:
subcomparator- the given comparator
-
-
Method Details
-
compare
INTERNAL: Compares the given typedIF objects using the comparator given to the constructor- Specified by:
comparein interfaceComparator<TypedIF>- Parameters:
obj1- an object; typecast to TypedIF by the grabberobj2- an object; typecast to TypedIF by the grabber- Returns:
- int; result from the comparator given to the constructor, when it compares the types of the given objects
-