public class TopicNameGrabber extends Object implements Function<TopicIF,TopicNameIF>
Modifier and Type | Field and Description |
---|---|
protected Comparator<TopicNameIF> |
comparator
PROTECTED: The comparator used to sort the base names.
|
Constructor and 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.
|
Modifier and Type | Method and 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.
|
protected Comparator<TopicNameIF> comparator
public TopicNameGrabber(Collection<TopicIF> scope)
scope
- A scope; a collection of TopicIF objects.public TopicNameGrabber(Comparator<TopicNameIF> comparator)
comparator
- The given comparatorpublic TopicNameIF apply(TopicIF topic)
apply
in interface Function<TopicIF,TopicNameIF>
topic
- A topic; formally an Object, but must implement TopicIF.throws
- OntopiaRuntimeException if the given topic is not
a TopicIF object.