Package net.ontopia.topicmaps.utils
Class CharacteristicUtils
- java.lang.Object
-
- net.ontopia.topicmaps.utils.CharacteristicUtils
-
public class CharacteristicUtils extends Object
INTERNAL: Characteristic processing utilities.
-
-
Constructor Summary
Constructors Constructor Description CharacteristicUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection<TopicIF>
getAssociatedTopics(TopicIF topic)
INTERNAL: Returns all the directly associated topics of the given topic.static <T extends TypedIF>
TgetByType(Collection<T> objects, TopicIF type)
INTERNAL: Finds first characteristic of a specified type.static Collection<OccurrenceIF>
getOccurrences(Collection<TopicIF> topics)
Gets the occurrences of all the topics in the given collection.static Collection<AssociationRoleIF>
getRoles(Collection<TopicIF> topics)
Gets the association roles of the topics in the given collection.static Collection<TopicNameIF>
getTopicNames(Collection<TopicIF> topics)
INTERNAL: Gets the basenames of the given collection of topics.static Collection<TopicIF>
getTopicsOfTopicNames(Collection<TopicNameIF> basenames)
INTERNAL: Gets the topics of a collection of basenames.static Collection<VariantNameIF>
getVariants(Collection<TopicNameIF> names)
Gets all the variant names of the given collecton of basenames, including nested ones.
-
-
-
Method Detail
-
getByType
public static <T extends TypedIF> T getByType(Collection<T> objects, TopicIF type)
INTERNAL: Finds first characteristic of a specified type.- Parameters:
objects
- A collection of TypedIF objects.- Returns:
- The first object that has the specified type.
- Since:
- 2.0
-
getTopicNames
public static Collection<TopicNameIF> getTopicNames(Collection<TopicIF> topics)
INTERNAL: Gets the basenames of the given collection of topics.- Parameters:
topics
- A scope; a collection of TopicIF objects.- Returns:
- An ArrayList of TopicNameIF objects; the base names of all the topics in the given collection.
-
getVariants
public static Collection<VariantNameIF> getVariants(Collection<TopicNameIF> names)
Gets all the variant names of the given collecton of basenames, including nested ones.- Parameters:
names
- A collection of TopicNameIF objects.- Returns:
- The variant names of all the basenames in the given collection; an ArrayList of VariantNameIF objects.
-
getOccurrences
public static Collection<OccurrenceIF> getOccurrences(Collection<TopicIF> topics)
Gets the occurrences of all the topics in the given collection.- Parameters:
topics
- A collection of TopicIF objects; a scope.- Returns:
- An ArrayList of OccurrenceIF objects; all the occurrences of the topics in the given collection.
-
getRoles
public static Collection<AssociationRoleIF> getRoles(Collection<TopicIF> topics)
Gets the association roles of the topics in the given collection.- Parameters:
topics
- A collection of TopicIF objects; a scope.- Returns:
- An ArrayList of AssociationRoleIF objects; all the association roles of the topics in the given collection.
-
getTopicsOfTopicNames
public static Collection<TopicIF> getTopicsOfTopicNames(Collection<TopicNameIF> basenames)
INTERNAL: Gets the topics of a collection of basenames.- Parameters:
basenames
- A collection of TopicNameIFs.- Returns:
- A collection of TopicIF objects; the topics to which the basenames belong.
-
getAssociatedTopics
public static Collection<TopicIF> getAssociatedTopics(TopicIF topic)
INTERNAL: Returns all the directly associated topics of the given topic.- Since:
- 3.4
-
-