|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.topicmaps.utils.TypeHierarchyUtils
public class TypeHierarchyUtils
INTERNAL: This class provides utility functions for traversing class hierarchies which are expressed using the Published Subject Indicators (PSIs) defined by the XTM 1.0 Specification. Operations provided by this class are not thread-safe.
Constructor Summary | |
---|---|
TypeHierarchyUtils()
INTERNAL: Creates and initialises a new instance of the utility class. |
Method Summary | |
---|---|
java.util.Collection<TopicIF> |
getSubclasses(TopicIF klass)
INTERNAL: Returns the topics which are subtypes of the topic klass. |
java.util.Collection<TopicIF> |
getSubclasses(TopicIF klass,
int level)
INTERNAL: Returns the topics which are subtypes of the given typing topic down to a given level. |
java.util.Collection<TopicIF> |
getSuperclasses(TopicIF klass)
INTERNAL: Returns the topics which are supertypes of the given typing topic |
java.util.Collection<TopicIF> |
getSuperclasses(TopicIF klass,
int level)
INTERNAL: Returns the topics which are supertypes of the given typing topic up to a given level. |
java.util.Collection<TopicIF> |
getSupertypes(TopicIF typed)
INTERNAL: Returns the topics which types of the object typed and all their supertypes. |
java.util.Collection<TopicIF> |
getSupertypes(TopicIF typed,
boolean excludeTypes)
INTERNAL: Returns the topics which types the object typed (if not excludeTypes is set to
true) and all their supertypes. |
java.util.Collection<TopicIF> |
getSupertypes(TypedIF typed)
INTERNAL: Returns the topic which types the singly typed object typed and all of its supertypes. |
boolean |
isAssociatedWith(TopicIF start,
TopicIF associated)
INTERNAL: Returns true if the two topics are directly or indirectly associated under the association type and rolespec definitions provided in the constructor for this walker. |
boolean |
isInstanceOf(TopicIF typed,
TopicIF klass)
INTERNAL: Determines if the typed
is an instance of the type klass . |
boolean |
isInstanceOf(TypedIF typed,
TopicIF klass)
INTERNAL: Determines if the singly-typed object typed
is an instance of the type klass . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TypeHierarchyUtils()
Method Detail |
---|
public boolean isInstanceOf(TypedIF typed, TopicIF klass)
typed
is an instance of the type klass
. This function
returns true if typed
is a direct instance of
klass
or if it is an instance of some subtype of
klass
.
typed
- the given typedIF objectklass
- a topicIF object; the given type
public boolean isInstanceOf(TopicIF typed, TopicIF klass)
typed
is an instance of the type klass
. This function
returns true if typed
is a direct instance of
klass
or if it is an instance of some subclass of
klass
.
typed
- the given typedIF objectklass
- a topicIF object; the given type
public boolean isAssociatedWith(TopicIF start, TopicIF associated)
start
- The topic to begin computation from; an object
implementing TopicIF.associated
- The topic to be found in the association; an
object implementing TopicIF.
public java.util.Collection<TopicIF> getSuperclasses(TopicIF klass)
klass
- a topicIF; the given typing topic
public java.util.Collection<TopicIF> getSuperclasses(TopicIF klass, int level)
klass
- a topicIF; the given typing topiclevel
- the level to which superclasses are to be found
public java.util.Collection<TopicIF> getSubclasses(TopicIF klass)
klass
- a topicIF; the given typing topic
public java.util.Collection<TopicIF> getSubclasses(TopicIF klass, int level)
klass
- a topicIF; the given typing topiclevel
- the level to which subclasses are to be found
public java.util.Collection<TopicIF> getSupertypes(TypedIF typed)
typed
and all of its supertypes.
typed
- a typedIF object
public java.util.Collection<TopicIF> getSupertypes(TopicIF typed)
typed
and all their supertypes.
typed
- a topic
public java.util.Collection<TopicIF> getSupertypes(TopicIF typed, boolean excludeTypes)
typed
(if not excludeTypes
is set to
true) and all their supertypes.
typed
- a topicexcludeTypes
- types of specified topic are not in returned
collection
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |