Class NameComparatorWithGenerality
java.lang.Object
net.ontopia.topicmaps.nav.utils.comparators.NameComparator
net.ontopia.topicmaps.nav.utils.comparators.NameComparatorWithGenerality
- All Implemented Interfaces:
Comparator<NameIF>
INTERNAL: A Comparator for ordering TopicNameIFs and VariantNameIFs
first after their generality (determined by the number of themes in
their scopes, which means that the name in the unconstrained scope
would always appear first) and second alphabetically
(case-independent).
-
Field Summary
Fields inherited from class net.ontopia.topicmaps.nav.utils.comparators.NameComparator
scopes, sortNameGrabber, vnGrabber -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor, used on application startup to initialise a "fast" comparator which will compare TopicNameIFs and VariantNameIFs using no context.NameComparatorWithGenerality(Collection<TopicIF> context) Constructor used to make a comparator which will compare TopicNameIFs and VariantNameIFs using the context provided. -
Method Summary
Methods inherited from class net.ontopia.topicmaps.nav.utils.comparators.NameComparator
compare, initSortNameGrabberMethods 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
-
Constructor Details
-
NameComparatorWithGenerality
public NameComparatorWithGenerality()Empty constructor, used on application startup to initialise a "fast" comparator which will compare TopicNameIFs and VariantNameIFs using no context. -
NameComparatorWithGenerality
Constructor used to make a comparator which will compare TopicNameIFs and VariantNameIFs using the context provided.
-
-
Method Details
-
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. The resulting string contains first the number of themes and after that the name.- Overrides:
getNamein classNameComparator
-