org.tmapi.index.core
Interface TopicsIndex

All Superinterfaces:
Index, TopicMapSystem.ConfigurableHelperObject

public interface TopicsIndex
extends Index

An index of the Topics in the TopicMap. This index provides methods to retrieve all of the Topics in the TopicMap which are used to define the type of one or more Topics in the TopicMap. The index also provides methods to retrieve all Topics with one or more types and to retrieve Topics by their reified subject address or subject indicators.

Since:
1.0

Method Summary
 Topic getTopicBySubjectIdentifier(Locator subjectIdentifier)
          Retrieve the Topic in the TopicMap that has the specified Locator as its subject indicator.
 Topic getTopicBySubjectLocator(Locator subjectLocator)
          Retrieve the Topic in the TopicMap that has the specified Locator as its subject Locator.
 java.util.Collection getTopicsByType(Topic type)
          Retrieve the Topics in the TopicMap that include the Topic type as one of their types.
 java.util.Collection getTopicsByTypes(Topic[] types, boolean matchAll)
          Retrieve the Topics in the TopicMap that include all of the specified topics amongst their types.
 java.util.Collection getTopicTypes()
          Retrieve the Topics that are used as topic types in the indexed TopicMap.
 
Methods inherited from interface org.tmapi.index.Index
close, getFlags, isOpen, open, reindex
 
Methods inherited from interface org.tmapi.core.TopicMapSystem.ConfigurableHelperObject
configure
 

Method Detail

getTopicTypes

public java.util.Collection getTopicTypes()
Retrieve the Topics that are used as topic types in the indexed TopicMap. The return value may be an empty Collection but must never be null.

Returns:
a Collection of Topic instances.

getTopicsByType

public java.util.Collection getTopicsByType(Topic type)
Retrieve the Topics in the TopicMap that include the Topic type as one of their types. The return value may be an empty Collection but must never be null.

Parameters:
type - the type of the Topics to be returned If type is null a collection containing all untyped Topics will be returned
Returns:
a Collection of Topic instances.

getTopicsByTypes

public java.util.Collection getTopicsByTypes(Topic[] types,
                                             boolean matchAll)
Retrieve the Topics in the TopicMap that include all of the specified topics amongst their types. The return value may be an empty Collection but must never be null.

Parameters:
types - the types of the Topics to be returned (MUST NOT be null)
matchAll - if true, then only those Topic instances where all of the Topics in types are present as type property will be returned (this includes the superset of the given Topics in the types argument), otherwise all Topics where one ore more of the Topics specified in types are present as type property will be returned.
Returns:
a Collection of Topic instances.

getTopicBySubjectLocator

public Topic getTopicBySubjectLocator(Locator subjectLocator)
Retrieve the Topic in the TopicMap that has the specified Locator as its subject Locator.

Parameters:
subjectLocator - the subject locator of the Topic to retrieve (MUST NOT be null).
Returns:
a Topic instance or null if no Topic has the specified subject locator.

getTopicBySubjectIdentifier

public Topic getTopicBySubjectIdentifier(Locator subjectIdentifier)
Retrieve the Topic in the TopicMap that has the specified Locator as its subject indicator.

Parameters:
subjectIdentifier - the subject identifier of the Topic to retrieve (MUST NOT be null).
Returns:
a Topic instance or null if no Topic has the specified subject identifier.