Class NameComparator
java.lang.Object
net.ontopia.topicmaps.nav.utils.comparators.NameComparator
- All Implemented Interfaces:
Comparator<NameIF>
- Direct Known Subclasses:
NameComparatorWithGenerality
INTERNAL: A Comparator for ordering TopicNameIFs and VariantNameIFs
alphabetically (case-independent).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Collection<TopicIF>protected VariantNameGrabberprotected VariantNameGrabber -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor, used on application startup to initialise a "fast" comparator which will compare TopicNameIFs and VariantNameIFs using no context.NameComparator(Collection<TopicIF> context) Constructor used to make a comparator which will compare TopicNameIFs and VariantNameIFs using the context provided. -
Method Summary
Modifier and TypeMethodDescriptionintCompares two TopicNameIFs / VariantNameIFs.protected StringINTERNAL: helper method which gets out of the object the base name or variant name value.protected final voidinitSortNameGrabber(TMObjectIF tmObj) INTERNAL: setup variant sort name grabber.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
-
scopes
-
vnGrabber
-
sortNameGrabber
-
-
Constructor Details
-
NameComparator
public NameComparator()Empty constructor, used on application startup to initialise a "fast" comparator which will compare TopicNameIFs and VariantNameIFs using no context. -
NameComparator
Constructor used to make a comparator which will compare TopicNameIFs and VariantNameIFs using the context provided.
-
-
Method Details
-
initSortNameGrabber
INTERNAL: setup variant sort name grabber. Attention: reuse same sort name grabber for this NameComparator object instance, so be sure all objects are in the same topicmap. -
getName
INTERNAL: helper method which gets out of the object the base name or variant name value. If it's a basename try to retrieve the sort variant name for it. -
compare
Compares two TopicNameIFs / VariantNameIFs.- Specified by:
comparein interfaceComparator<NameIF>
-