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 Details

    • comparator

      protected Comparator<TopicNameIF> comparator
      PROTECTED: The comparator used to sort the base names.
  • Constructor Details

    • 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 Details

    • 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 interface Function<TopicIF,TopicNameIF>
      Parameters:
      topic - A topic; formally an Object, but must implement TopicIF.