|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ontopia.topicmaps.utils.NameGrabber
public class NameGrabber
INTERNAL: Grabber that grabs the most suitable name from a topic, measured by whether it contains a particular theme in its scope. If the topic has a variant name with the given theme the belonging basename will be chosen. If not, the base name in the least constrained scope will be chosen.
Constructor Summary | |
---|---|
NameGrabber(java.util.Collection scope)
INTERNAL: Creates the grabber and sets the comparator to be a ScopedIFComparator using the specified scope. |
|
NameGrabber(java.util.Collection basenameScope,
java.util.Collection variantScope)
INTERNAL: Creates the grabber and sets the comparator to be a ScopedIFComparator using the specified scope. |
|
NameGrabber(java.util.Collection basenameScope,
java.util.Collection variantScope,
boolean grabOnlyTopicName)
INTERNAL: Creates the grabber and sets the comparator to be a ScopedIFComparator using the specified scope. |
|
NameGrabber(LocatorIF themeIndicator)
INTERNAL: Creates the grabber and sets the comparator to be a ScopedIFComparator using the least constrained scope. |
|
NameGrabber(LocatorIF themeIndicator,
boolean variant)
PUBLIC: Creates the grabber and sets the comparator to be a ScopedIFComparator using the least constrained scope. |
Method Summary | |
---|---|
boolean |
getGrabOnlyTopicName()
INTERNAL: Gets the grab policy. |
java.lang.Object |
grab(java.lang.Object object)
INTERNAL: Grabs the most appropiate base name (or if grabOnlyTopicName is false allow also to return the
most appropiate VariantIF instance). |
void |
setGrabOnlyTopicName(boolean grabOnlyTopicName)
INTERNAL: Sets the grab policy, if only instances of BasenameIF should be returned by grab, or also the more appropiate VariantIF. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NameGrabber(LocatorIF themeIndicator)
public NameGrabber(LocatorIF themeIndicator, boolean variant)
variant
- Whether to use the indicator to set the variant
scope (if false it is used for the base name scope)public NameGrabber(java.util.Collection scope)
public NameGrabber(java.util.Collection basenameScope, java.util.Collection variantScope)
public NameGrabber(java.util.Collection basenameScope, java.util.Collection variantScope, boolean grabOnlyTopicName)
grabOnlyTopicName
to
specify the policy) that have most in common with specified
scope.
Method Detail |
---|
public void setGrabOnlyTopicName(boolean grabOnlyTopicName)
public boolean getGrabOnlyTopicName()
setGrabOnlyTopicName(boolean)
public java.lang.Object grab(java.lang.Object object)
grabOnlyTopicName
is false allow also to return the
most appropiate VariantIF instance). The name returned is the
first suitable base name belonging to a variant name found, when
the basenames of the give topic have been sorted using the
comparator. If there is no suitable base name belonging to a
variant name, then the last base name found is returned,
corresponding to the least constrained scope.
grab
in interface GrabberIF
object
- The topic whose name is being grabbed; formally an object.
throws
- OntopiaRuntimeException if object is not a topic.
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |