net.ontopia.topicmaps.utils
Class ClassInstanceUtils

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

public class ClassInstanceUtils
extends java.lang.Object

INTERNAL: Utilities for working with class-instance relationships.


Constructor Summary
ClassInstanceUtils()
           
 
Method Summary
static java.util.Collection getInstancesOf(java.util.Collection typed, TopicIF type)
          INTERNAL: Returns the typed objects that are instances of the given type.
static java.util.Map getTypeMap(java.util.Collection typed)
          INTERNAL: Returns a Map containing the typed objects keyed by type.
static java.util.Map getTypeMap(java.util.Collection typed, java.util.Map accumulated)
          INTERNAL: Modifies the accumulated map to also include the type map of the typed objects.
static java.util.Collection getTypes(java.util.Collection typed)
          INTERNAL: Returns the topics that are the type/class topic of the typed objects.
static java.util.Collection getTypes(java.util.Collection typed, java.util.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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassInstanceUtils

public ClassInstanceUtils()
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 java.util.Collection getInstancesOf(java.util.Collection typed,
                                                  TopicIF type)
INTERNAL: Returns the typed objects that are instances of the given type.


getTypes

public static java.util.Collection getTypes(java.util.Collection typed)
INTERNAL: Returns the topics that are the type/class topic of the typed objects.


getTypes

public static java.util.Collection getTypes(java.util.Collection typed,
                                            java.util.Collection accumulated)
INTERNAL: Modifies the accumulated collection to also include the types of the typed objects.


getTypeMap

public static java.util.Map getTypeMap(java.util.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 java.util.Map getTypeMap(java.util.Collection typed,
                                       java.util.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.



Copyright © 2000-2012 Ontopia.