Package net.ontopia.topicmaps.utils
Class TopicStringifiers
java.lang.Object
net.ontopia.topicmaps.utils.TopicStringifiers
PUBLIC: Creates stringifiers that extract strings representing
names from topics, according to various criteria, including scope.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionPUBLIC: Gets a stringifier that will return a default name for each topic it is applied to.PUBLIC: Gets a fast stringifier that will return the sort names of topics, when they have one.PUBLIC: Gets a stringifier that will return the sort names of topics, when they have one.getStringifier(Collection<TopicIF> tnscope, Collection<TopicIF> vnscope) PUBLIC: Gets a stringifier that will return the name it determines matches the given scopes best.getTopicNameStringifier(Collection<TopicIF> scope) PUBLIC: Gets a stringifier that will return the topic name it determines to match the given scope best.PUBLIC: Gets a stringifier that will return the variant that it determines to match the given scope best.static StringPUBLIC: Returns the default name of the topic.static StringtoString(TopicIF topic, Collection<TopicIF> tnscope) PUBLIC: Returns the name of the topic given the specified topic name theme.static StringtoString(TopicIF topic, Collection<TopicIF> tnscope, Collection<TopicIF> vnscope) PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.static StringtoString(TopicIF topic, Collection<TopicIF> tnscope, TopicIF vntheme) PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.static StringPUBLIC: Returns the name of the topic given the specified topic name theme.static StringPUBLIC: Returns the name of the topic given the specified topic name and variant name themes.
-
Method Details
-
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: 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: 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: 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: 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 Function<TopicIF,String> getStringifier(Collection<TopicIF> tnscope, Collection<TopicIF> 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 namesvnscope- collection of TopicIF objects; the scope applied to variant names- Returns:
- the configured stringifier
- Since:
- 1.3.2
-
toString
PUBLIC: Returns the default name of the topic.- Since:
- 2.0
-
toString
PUBLIC: Returns the name of the topic given the specified topic name theme.- Since:
- 2.0
-
toString
PUBLIC: Returns the name of the topic given the specified topic name theme.- Since:
- 2.0
-
toString
PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.- Since:
- 2.0
-
toString
PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.- Since:
- 2.0
-
toString
public static String toString(TopicIF topic, Collection<TopicIF> tnscope, Collection<TopicIF> vnscope) PUBLIC: Returns the name of the topic given the specified topic name and variant name themes.- Since:
- 2.0
-