public class TypeHierarchyUtils extends Object
Constructor and Description |
---|
TypeHierarchyUtils()
INTERNAL: Creates and initialises a new instance of the utility class.
|
Modifier and Type | Method and Description |
---|---|
Collection<TopicIF> |
getSubclasses(TopicIF klass)
INTERNAL: Returns the topics which are subtypes of the topic klass.
|
Collection<TopicIF> |
getSubclasses(TopicIF klass,
int level)
INTERNAL: Returns the topics which are subtypes of the given typing
topic down to a given level.
|
Collection<TopicIF> |
getSuperclasses(TopicIF klass)
INTERNAL: Returns the topics which are supertypes of the given typing topic
|
Collection<TopicIF> |
getSuperclasses(TopicIF klass,
int level)
INTERNAL: Returns the topics which are supertypes of the given
typing topic up to a given level.
|
Collection<TopicIF> |
getSupertypes(TopicIF typed)
INTERNAL: Returns the topics which types of the object
typed and all their supertypes. |
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. |
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 . |
public TypeHierarchyUtils()
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 typepublic 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 typepublic 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 Collection<TopicIF> getSuperclasses(TopicIF klass)
klass
- a topicIF; the given typing topicpublic Collection<TopicIF> getSuperclasses(TopicIF klass, int level)
klass
- a topicIF; the given typing topiclevel
- the level to which superclasses are to be foundpublic Collection<TopicIF> getSubclasses(TopicIF klass)
klass
- a topicIF; the given typing topicpublic Collection<TopicIF> getSubclasses(TopicIF klass, int level)
klass
- a topicIF; the given typing topiclevel
- the level to which subclasses are to be foundpublic Collection<TopicIF> getSupertypes(TypedIF typed)
typed
and all of its supertypes.typed
- a typedIF objectpublic Collection<TopicIF> getSupertypes(TopicIF typed)
typed
and all their supertypes.typed
- a topicpublic 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