Package net.ontopia.topicmaps.utils
Class ClassInstanceUtils
- java.lang.Object
-
- net.ontopia.topicmaps.utils.ClassInstanceUtils
-
public class ClassInstanceUtils extends Object
INTERNAL: Utilities for working with class-instance relationships.
-
-
Constructor Summary
Constructors Constructor Description ClassInstanceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Collection
getInstancesOf(Collection typed, TopicIF type)
INTERNAL: Returns the typed objects that are instances of the given type.static Map
getTypeMap(Collection typed)
INTERNAL: Returns a Map containing the typed objects keyed by type.static Map
getTypeMap(Collection typed, Map accumulated)
INTERNAL: Modifies the accumulated map to also include the type map of the typed objects.static Collection
getTypes(Collection typed)
INTERNAL: Returns the topics that are the type/class topic of the typed objects.static Collection
getTypes(Collection typed, Collection accumulated)
INTERNAL: Modifies the accumulated collection to also include the types of the typed objects.static boolean
isInstanceOf(TopicIF topic, TopicIF type)
INTERNAL: Returns true if the TopicIF object is an instance the given type.static boolean
isInstanceOf(TypedIF typed, TopicIF type)
INTERNAL: Returns true if the TypedIF object is an instance the given type.static void
resolveAssociations1(TopicMapIF topicmap)
INTERNAL: Replaces all class-instance associations in a topic map by direct references from the topics in question to their types.static void
resolveAssociations2(TopicMapIF topicmap)
INTERNAL: Replaces all class-instance associations using the XTM 2.0 PSIs in a topic map by direct references from the topics in question to their types.
-
-
-
Method Detail
-
resolveAssociations1
public static void resolveAssociations1(TopicMapIF topicmap)
INTERNAL: Replaces all class-instance associations in a topic map by direct references from the topics in question to their types. Only associations that use the PSIs defined in XTM 1.0, that match the templates exactly, that are not reified, and that are not scoped are replaced.- Since:
- 1.2.3
-
resolveAssociations2
public static void resolveAssociations2(TopicMapIF topicmap)
INTERNAL: Replaces all class-instance associations using the XTM 2.0 PSIs in a topic map by direct references from the topics in question to their types. Only associations that use the PSIs defined in XTM 2.0, that match the templates exactly, that are not reified, and that are not scoped are replaced.
-
isInstanceOf
public static boolean isInstanceOf(TypedIF typed, TopicIF type)
INTERNAL: Returns true if the TypedIF object is an instance the given type.
-
isInstanceOf
public static boolean isInstanceOf(TopicIF topic, TopicIF type)
INTERNAL: Returns true if the TopicIF object is an instance the given type.
-
getInstancesOf
public static Collection getInstancesOf(Collection typed, TopicIF type)
INTERNAL: Returns the typed objects that are instances of the given type.
-
getTypes
public static Collection getTypes(Collection typed)
INTERNAL: Returns the topics that are the type/class topic of the typed objects.
-
getTypes
public static Collection getTypes(Collection typed, Collection accumulated)
INTERNAL: Modifies the accumulated collection to also include the types of the typed objects.
-
getTypeMap
public static Map getTypeMap(Collection typed)
INTERNAL: Returns a Map containing the typed objects keyed by type. The value of a map entry is always a Collection instance.
-
getTypeMap
public static Map getTypeMap(Collection typed, Map accumulated)
INTERNAL: Modifies the accumulated map to also include the type map of the typed objects. The value of a map entry is always a Collection instance.
-
-