net.ontopia.topicmaps.utils
Class TopicNameGrabber

java.lang.Object
  extended by net.ontopia.topicmaps.utils.TopicNameGrabber
All Implemented Interfaces:
GrabberIF<TopicIF,TopicNameIF>

public class TopicNameGrabber
extends Object
implements GrabberIF<TopicIF,TopicNameIF>

INTERNAL: Grabber that grabs the most appropriate basename from a topic.


Field Summary
protected  Comparator<TopicNameIF> comparator
          PROTECTED: The comparator used to sort the base names.
 
Constructor Summary
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
 TopicNameIF grab(TopicIF topic)
          INTERNAL: Grabs the most appropriate base name for the given topic, using the comparator established at creation to compare available base names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

grab

public TopicNameIF grab(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:
grab in interface GrabberIF<TopicIF,TopicNameIF>
Parameters:
topic - A topic; formally an Object, but must implement TopicIF.
Throws:
throws - OntopiaRuntimeException if the given topic is not a TopicIF object.


Copyright © 2000-2012 Ontopia.