net.ontopia.topicmaps.utils
Class TopicStringifiers

java.lang.Object
  extended by net.ontopia.topicmaps.utils.TopicStringifiers

public class TopicStringifiers
extends java.lang.Object

PUBLIC: Creates stringifiers that extract strings representing names from topics, according to various criteria, including scope.


Nested Class Summary
static class TopicStringifiers.FastSortNameStringifier
           
 
Method Summary
static StringifierIF getDefaultStringifier()
          PUBLIC: Gets a stringifier that will return a default name for each topic it is applied to.
static StringifierIF getFastSortNameStringifier(TopicMapIF tm)
          PUBLIC: Gets a fast stringifier that will return the sort names of topics, when they have one.
static StringifierIF getSortNameStringifier()
          PUBLIC: Gets a stringifier that will return the sort names of topics, when they have one.
static StringifierIF getStringifier(java.util.Collection tnscope, java.util.Collection vnscope)
          PUBLIC: Gets a stringifier that will return the name it determines matches the given scopes best.
static StringifierIF getTopicNameStringifier(java.util.Collection scope)
          PUBLIC: Gets a stringifier that will return the topic name it determines to match the given scope best.
static StringifierIF getVariantNameStringifier(java.util.Collection scope)
          PUBLIC: Gets a stringifier that will return the variant that it determines to match the given scope best.
static java.lang.String toString(TopicIF topic)
          PUBLIC: Returns the default name of the topic.
static java.lang.String toString(TopicIF topic, java.util.Collection tnscope)
          PUBLIC: Returns the name of the topic given the specified topic name theme.
static java.lang.String toString(TopicIF topic, java.util.Collection tnscope, java.util.Collection vnscope)
          PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.
static java.lang.String toString(TopicIF topic, java.util.Collection tnscope, TopicIF vntheme)
          PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.
static java.lang.String toString(TopicIF topic, TopicIF tntheme)
          PUBLIC: Returns the name of the topic given the specified topic name theme.
static java.lang.String toString(TopicIF topic, TopicIF tntheme, TopicIF vntheme)
          PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefaultStringifier

public static StringifierIF getDefaultStringifier()
PUBLIC: Gets a stringifier that will return a default name for each topic it is applied to.

Returns:
stringifierIF; the string this returns will be the display name of its given topic if present, otherwise the least constrained topic name.

getTopicNameStringifier

public static StringifierIF getTopicNameStringifier(java.util.Collection scope)
PUBLIC: Gets a stringifier that will return the topic name it determines to match the given scope best. There are no guarantees as to which topic name it will return if more than one topic name match equally well.

Parameters:
scope - collection of TopicIF objects; the given scope
Returns:
stringifierIF; the string this stringifier returns will be a topic name of its given topic, selected according to the logic in TopicNameGrabber.

getVariantNameStringifier

public static StringifierIF getVariantNameStringifier(java.util.Collection scope)
PUBLIC: Gets a stringifier that will return the variant that it determines to match the given scope best. There are no guarantees as to which variant name it will return if more than one variant name matches equally well.

Parameters:
scope - collection of TopicIF objects; the given scope
Returns:
stringifierIF; the string this stringifier returns will be a variant name of its given topic, selected according to the logic in VariantNameGrabber.

getSortNameStringifier

public static StringifierIF getSortNameStringifier()
PUBLIC: Gets a stringifier that will return the sort names of topics, when they have one. If the topics have no sort name, one of the topic names will be used instead.

Returns:
StringifierIF; the string this stringifier returns will be a variant name of its given topic, selected according to the logic in SortNameGrabber.
Since:
1.1

getFastSortNameStringifier

public static StringifierIF getFastSortNameStringifier(TopicMapIF tm)
PUBLIC: Gets a fast stringifier that will return the sort names of topics, when they have one. If the topics have no sort name, one of the topic names will be used instead. This stringifier is the one used by tolog.

Since:
5.1.0

getStringifier

public static StringifierIF getStringifier(java.util.Collection tnscope,
                                           java.util.Collection vnscope)
PUBLIC: Gets a stringifier that will return the name it determines matches the given scopes best. There is no guarantee as to which name it will return if more than one name matches equally well.

Parameters:
tnscope - collection of TopicIF objects; the scope applied to topic names
vnscope - collection of TopicIF objects; the scope applied to variant names
Returns:
the configured stringifier
Since:
1.3.2

toString

public static java.lang.String toString(TopicIF topic)
PUBLIC: Returns the default name of the topic.

Since:
2.0

toString

public static java.lang.String toString(TopicIF topic,
                                        TopicIF tntheme)
PUBLIC: Returns the name of the topic given the specified topic name theme.

Since:
2.0

toString

public static java.lang.String toString(TopicIF topic,
                                        java.util.Collection tnscope)
PUBLIC: Returns the name of the topic given the specified topic name theme.

Since:
2.0

toString

public static java.lang.String toString(TopicIF topic,
                                        TopicIF tntheme,
                                        TopicIF vntheme)
PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.

Since:
2.0

toString

public static java.lang.String toString(TopicIF topic,
                                        java.util.Collection tnscope,
                                        TopicIF vntheme)
PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.

Since:
2.0

toString

public static java.lang.String toString(TopicIF topic,
                                        java.util.Collection tnscope,
                                        java.util.Collection vnscope)
PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.

Since:
2.0


Copyright © 2000-2012 Ontopia.