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