net.ontopia.topicmaps.impl.basic.index
Class ClassInstanceIndex

java.lang.Object
  extended by net.ontopia.topicmaps.impl.utils.AbstractIndex
      extended by net.ontopia.topicmaps.impl.utils.BasicIndex
          extended by net.ontopia.topicmaps.impl.basic.index.ClassInstanceIndex
All Implemented Interfaces:
ClassInstanceIndexIF, IndexIF, EventListenerIF

public class ClassInstanceIndex
extends BasicIndex
implements ClassInstanceIndexIF

INTERNAL: The basic dynamic class instance index implementation.


Nested Class Summary
 
Nested classes/interfaces inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
BasicIndex.EventHandler
 
Field Summary
protected  CollectionMap assocs
           
protected  CollectionMap bnames
           
protected  CollectionMap occurs
           
protected  CollectionMap roles
           
protected  CollectionMap topics
           
 
Fields inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
handlers
 
Method Summary
 java.util.Collection getAssociationRoles(TopicIF association_role_type)
          PUBLIC: Gets all association roles that are of the given type.
 java.util.Collection getAssociationRoleTypes()
          PUBLIC: Gets the topics that are used as association role types.
 java.util.Collection getAssociations(TopicIF association_type)
          PUBLIC: Gets all associations that are of the given type.
 java.util.Collection getAssociationTypes()
          PUBLIC: Gets the topics that are used as association types.
 java.util.Collection getOccurrences(TopicIF occurrence_type)
          PUBLIC: Gets all occurrences that are of the given type.
 java.util.Collection getOccurrenceTypes()
          PUBLIC: Gets the topics that are used as occurrence types.
 java.util.Collection getTopicNames(TopicIF basename_type)
          PUBLIC: Gets all topic names that are of the given type.
 java.util.Collection getTopicNameTypes()
          PUBLIC: Gets the topics that are used as topic name types.
 java.util.Collection getTopics(TopicIF topic_type)
          PUBLIC: Gets all topics that are instances of the given type.
 java.util.Collection getTopicTypes()
          PUBLIC: Gets all topics that are used as topic types.
 boolean usedAsAssociationRoleType(TopicIF topic)
          PUBLIC: Returns true if the topic is used as an association role type.
 boolean usedAsAssociationType(TopicIF topic)
          PUBLIC: Returns true if the topic is used as an association type.
 boolean usedAsOccurrenceType(TopicIF topic)
          PUBLIC: Returns true if the topic is used as an occurrence type.
 boolean usedAsTopicNameType(TopicIF topic)
          PUBLIC: Returns true if the topic is used as an topic name type.
 boolean usedAsTopicType(TopicIF topic)
          PUBLIC: Returns true if the topic is used as a topic type somewhere.
 boolean usedAsType(TopicIF topic)
          PUBLIC: Returns true if the topic is used as a type somewhere.
 
Methods inherited from class net.ontopia.topicmaps.impl.utils.BasicIndex
getIndex, processEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

topics

protected CollectionMap topics

bnames

protected CollectionMap bnames

occurs

protected CollectionMap occurs

assocs

protected CollectionMap assocs

roles

protected CollectionMap roles
Method Detail

getTopics

public java.util.Collection getTopics(TopicIF topic_type)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets all topics that are instances of the given type. Topic types are an abbreviated form of an association having roles for type and instance. This index provides optimized handling for topic types.

Specified by:
getTopics in interface ClassInstanceIndexIF
Parameters:
topic_type - The given type; an object implementing TopicIF.
Returns:
A collection of TopicIF objects; the instances of the type represented by the given topic.

getTopicNames

public java.util.Collection getTopicNames(TopicIF basename_type)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets all topic names that are of the given type.

Specified by:
getTopicNames in interface ClassInstanceIndexIF
Parameters:
basename_type - The given type; an object implementing TopicIF.
Returns:
A collection of TopicNameIF objects; topic names with the type represented by the given topic.

getOccurrences

public java.util.Collection getOccurrences(TopicIF occurrence_type)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets all occurrences that are of the given type.

Specified by:
getOccurrences in interface ClassInstanceIndexIF
Parameters:
occurrence_type - The given type; an object implementing TopicIF.
Returns:
A collection of OccurrenceIF objects; occurrences with the type represented by the given topic.

getAssociations

public java.util.Collection getAssociations(TopicIF association_type)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets all associations that are of the given type.

Specified by:
getAssociations in interface ClassInstanceIndexIF
Parameters:
association_type - The given type; an object implementing TopicIF.
Returns:
A collection of AssociationIF objects; associations with the type represented by the given topic.

getAssociationRoles

public java.util.Collection getAssociationRoles(TopicIF association_role_type)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets all association roles that are of the given type.

Specified by:
getAssociationRoles in interface ClassInstanceIndexIF
Parameters:
association_role_type - The given type; an object implementing TopicIF.
Returns:
A collection of AssociationRoleIF objects; association roles with the type represented by the given topic.

getTopicTypes

public java.util.Collection getTopicTypes()
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets all topics that are used as topic types.

Specified by:
getTopicTypes in interface ClassInstanceIndexIF
Returns:
A collection of TopicIF objects, each of which serves as a type for some topic.

getTopicNameTypes

public java.util.Collection getTopicNameTypes()
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets the topics that are used as topic name types.

Specified by:
getTopicNameTypes in interface ClassInstanceIndexIF
Returns:
A collection of TopicIF objects, each of which serves as a type for some topic name.

getOccurrenceTypes

public java.util.Collection getOccurrenceTypes()
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets the topics that are used as occurrence types.

Specified by:
getOccurrenceTypes in interface ClassInstanceIndexIF
Returns:
A collection of TopicIF objects, each of which serves as a type for some occurrence.

getAssociationTypes

public java.util.Collection getAssociationTypes()
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets the topics that are used as association types.

Specified by:
getAssociationTypes in interface ClassInstanceIndexIF
Returns:
A collection of TopicIF objects, each of which serves as a type for some association.

getAssociationRoleTypes

public java.util.Collection getAssociationRoleTypes()
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Gets the topics that are used as association role types.

Specified by:
getAssociationRoleTypes in interface ClassInstanceIndexIF
Returns:
A collection of TopicIF objects, each of which serves as a type for some association role.

usedAsTopicType

public boolean usedAsTopicType(TopicIF topic)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Returns true if the topic is used as a topic type somewhere.

Specified by:
usedAsTopicType in interface ClassInstanceIndexIF
Parameters:
topic - An object implementing TopicIF.
Returns:
Boolean: true if the given topic serves as a type for some topic; false otherwise.

usedAsTopicNameType

public boolean usedAsTopicNameType(TopicIF topic)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Returns true if the topic is used as an topic name type.

Specified by:
usedAsTopicNameType in interface ClassInstanceIndexIF
Parameters:
topic - An object implementing TopicIF.
Returns:
Boolean: true if the given topic serves as a type for some topic name; false otherwise.

usedAsOccurrenceType

public boolean usedAsOccurrenceType(TopicIF topic)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Returns true if the topic is used as an occurrence type.

Specified by:
usedAsOccurrenceType in interface ClassInstanceIndexIF
Parameters:
topic - An object implementing TopicIF.
Returns:
Boolean: true if the given topic serves as a type for some occurrence; false otherwise.

usedAsAssociationType

public boolean usedAsAssociationType(TopicIF topic)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Returns true if the topic is used as an association type.

Specified by:
usedAsAssociationType in interface ClassInstanceIndexIF
Parameters:
topic - An object implementing TopicIF.
Returns:
Boolean: true if the given topic serves as a type for some association; false otherwise.

usedAsAssociationRoleType

public boolean usedAsAssociationRoleType(TopicIF topic)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Returns true if the topic is used as an association role type.

Specified by:
usedAsAssociationRoleType in interface ClassInstanceIndexIF
Parameters:
topic - An object implementing TopicIF.
Returns:
Boolean: true if the given topic serves as a type for some association role; false otherwise.

usedAsType

public boolean usedAsType(TopicIF topic)
Description copied from interface: ClassInstanceIndexIF
PUBLIC: Returns true if the topic is used as a type somewhere.

Specified by:
usedAsType in interface ClassInstanceIndexIF
Parameters:
topic - An object implementing TopicIF.
Returns:
Boolean: true if the given topic serves as a type for any topic map object; false otherwise.


Copyright © 2000-2012 Ontopia.