public class TopicVariantNameGrabber extends Object implements Function<TopicIF,VariantNameIF>
Modifier and Type | Field and Description |
---|---|
protected Comparator<? super VariantNameIF> |
comparator
PROTECTED: The comparator used to sort the variant names.
|
Constructor and Description |
---|
TopicVariantNameGrabber(Collection<TopicIF> scope)
INTERNAL: Creates a grabber.
|
TopicVariantNameGrabber(Comparator<? super VariantNameIF> comparator)
INTERNAL: Creates a grabber which uses the given comparator.
|
Modifier and Type | Method and Description |
---|---|
VariantNameIF |
apply(TopicIF topic)
INTERNAL: Grabs the most appropriate variant name for the given
topic name, using the comparator established at creation to
compare available variant names.
|
protected Comparator<? super VariantNameIF> comparator
public TopicVariantNameGrabber(Collection<TopicIF> scope)
scope
- A scope; a collection of TopicIF objects.public TopicVariantNameGrabber(Comparator<? super VariantNameIF> comparator)
comparator
- The given comparatorpublic VariantNameIF apply(TopicIF topic)
apply
in interface Function<TopicIF,VariantNameIF>
topic
- an object, but must implement TopicIFthrows
- OntopiaRuntimeException if the given topic
is not a TopicIF object.