Package net.ontopia.topicmaps.utils
Class TopicVariantNameGrabber
java.lang.Object
net.ontopia.topicmaps.utils.TopicVariantNameGrabber
- All Implemented Interfaces:
Function<TopicIF,VariantNameIF>
INTERNAL: Grabber that grabs the most highest ranked variant name by
scope from a topic, ignoring the scope of the base names.
The grabber uses a ScopedIFComparator internally to rank all the
variant names of the given topic. If the topic has no applicable
variant names, null is returned.
- Since:
- 2.0.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Comparator<? super VariantNameIF>PROTECTED: The comparator used to sort the variant names. -
Constructor Summary
ConstructorsConstructorDescriptionTopicVariantNameGrabber(Collection<TopicIF> scope) INTERNAL: Creates a grabber.TopicVariantNameGrabber(Comparator<? super VariantNameIF> comparator) INTERNAL: Creates a grabber which uses the given comparator. -
Method Summary
Modifier and TypeMethodDescriptionINTERNAL: Grabs the most appropriate variant name for the given topic name, using the comparator established at creation to compare available variant names.
-
Field Details
-
comparator
PROTECTED: The comparator used to sort the variant names.
-
-
Constructor Details
-
TopicVariantNameGrabber
INTERNAL: Creates a grabber.- Parameters:
scope- A scope; a collection of TopicIF objects.
-
TopicVariantNameGrabber
INTERNAL: Creates a grabber which uses the given comparator.- Parameters:
comparator- The given comparator
-
-
Method Details
-
apply
INTERNAL: Grabs the most appropriate variant name for the given topic name, using the comparator established at creation to compare available variant names.- Specified by:
applyin interfaceFunction<TopicIF,VariantNameIF> - Parameters:
topic- an object, but must implement TopicIF- Returns:
- the most applicable variant name, or null.
-