net.ontopia.topicmaps.utils
Class TopicNameGrabber

java.lang.Object
  extended by net.ontopia.topicmaps.utils.TopicNameGrabber
All Implemented Interfaces:
GrabberIF

public class TopicNameGrabber
extends java.lang.Object
implements GrabberIF

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


Field Summary
protected  java.util.Comparator comparator
          PROTECTED: The comparator used to sort the base names.
 
Constructor Summary
TopicNameGrabber(java.util.Collection scope)
          INTERNAL: Creates a grabber; uses a BaseComparator with the given scope.
TopicNameGrabber(java.util.Comparator comparator)
          INTERNAL: Creates a grabber which uses the given comparator.
 
Method Summary
 java.lang.Object grab(java.lang.Object 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 java.util.Comparator comparator
PROTECTED: The comparator used to sort the base names.

Constructor Detail

TopicNameGrabber

public TopicNameGrabber(java.util.Collection scope)
INTERNAL: Creates a grabber; uses a BaseComparator with the given scope.

Parameters:
scope - A scope; a collection of TopicIF objects.

TopicNameGrabber

public TopicNameGrabber(java.util.Comparator comparator)
INTERNAL: Creates a grabber which uses the given comparator.

Parameters:
comparator - The given comparator
Method Detail

grab

public java.lang.Object grab(java.lang.Object 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
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.