Package net.ontopia.topicmaps.utils
Class TopicNameGrabber
- java.lang.Object
-
- net.ontopia.topicmaps.utils.TopicNameGrabber
-
- All Implemented Interfaces:
Function<TopicIF,TopicNameIF>
public class TopicNameGrabber extends Object implements Function<TopicIF,TopicNameIF>
INTERNAL: Grabber that grabs the most appropriate basename from a topic.
-
-
Field Summary
Fields Modifier and Type Field Description protected Comparator<TopicNameIF>
comparator
PROTECTED: The comparator used to sort the base names.
-
Constructor Summary
Constructors Constructor Description TopicNameGrabber(Collection<TopicIF> scope)
INTERNAL: Creates a grabber; uses a BaseComparator with the given scope.TopicNameGrabber(Comparator<TopicNameIF> comparator)
INTERNAL: Creates a grabber which uses the given comparator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TopicNameIF
apply(TopicIF topic)
INTERNAL: Grabs the most appropriate base name for the given topic, using the comparator established at creation to compare available base names.
-
-
-
Field Detail
-
comparator
protected Comparator<TopicNameIF> comparator
PROTECTED: The comparator used to sort the base names.
-
-
Constructor Detail
-
TopicNameGrabber
public TopicNameGrabber(Collection<TopicIF> scope)
INTERNAL: Creates a grabber; uses a BaseComparator with the given scope.- Parameters:
scope
- A scope; a collection of TopicIF objects.
-
TopicNameGrabber
public TopicNameGrabber(Comparator<TopicNameIF> comparator)
INTERNAL: Creates a grabber which uses the given comparator.- Parameters:
comparator
- The given comparator
-
-
Method Detail
-
apply
public TopicNameIF apply(TopicIF topic)
INTERNAL: Grabs the most appropriate base name for the given topic, using the comparator established at creation to compare available base names.- Specified by:
apply
in interfaceFunction<TopicIF,TopicNameIF>
- Parameters:
topic
- A topic; formally an Object, but must implement TopicIF.
-
-