de.topicmapslab.majortom.index.nonpaged
Class CachedTransitiveTypeInstanceIndex<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

java.lang.Object
  extended by de.topicmapslab.majortom.index.IndexImpl<T>
      extended by de.topicmapslab.majortom.index.core.BaseCachedIndexImpl<E>
          extended by de.topicmapslab.majortom.index.core.BaseCachedTypeInstanceIndexImpl<E>
              extended by de.topicmapslab.majortom.index.nonpaged.CachedTypeInstanceIndexImpl<T>
                  extended by de.topicmapslab.majortom.index.nonpaged.CachedTransitiveTypeInstanceIndex<T>
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, de.topicmapslab.majortom.model.index.IIndex, de.topicmapslab.majortom.model.index.ITransitiveTypeInstanceIndex, de.topicmapslab.majortom.model.index.ITypeInstanceIndex, org.tmapi.index.Index, org.tmapi.index.TypeInstanceIndex
Direct Known Subclasses:
RedisTransitiveTypeInstanceIndex

public class CachedTransitiveTypeInstanceIndex<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
extends CachedTypeInstanceIndexImpl<T>
implements de.topicmapslab.majortom.model.index.ITransitiveTypeInstanceIndex

Author:
Sven Krosse

Constructor Summary
CachedTransitiveTypeInstanceIndex(T store)
          constructor
 
Method Summary
 java.util.Collection<org.tmapi.core.Association> doGetAssociations(java.util.Collection<? extends org.tmapi.core.Topic> types)
          Returns all association items typed by one of the given types.
 java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic type)
          Return all associations of the given type within the given range
protected  java.util.Collection<org.tmapi.core.Topic> doGetAssociationTypes()
          Returns all association types of the topic map.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.util.Collection<? extends org.tmapi.core.Topic> types)
          Returns all characteristics typed by one of given types.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(org.tmapi.core.Topic... types)
          
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(org.tmapi.core.Topic type)
          Returns all characteristics being typed by the given of topic type.
protected  java.util.Collection<org.tmapi.core.Topic> doGetCharacteristicTypes()
          Returns all characteristic types contained by the topic map.
 java.util.Collection<org.tmapi.core.Name> doGetNames(java.util.Collection<? extends org.tmapi.core.Topic> types)
          Returns all names typed by one of the given types.
 java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic type)
          Return all names of the given type within the given range.
protected  java.util.Collection<org.tmapi.core.Topic> doGetNameTypes()
          Return all name types of the topic map within the given range.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.util.Collection<? extends org.tmapi.core.Topic> types)
          Returns all occurrences typed by one of the given types.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic type)
          Return all occurrences of the given type within the given range.
protected  java.util.Collection<org.tmapi.core.Topic> doGetOccurrenceTypes()
          Return all occurrence types of the topic map within the given range.
 java.util.Collection<org.tmapi.core.Role> doGetRoles(java.util.Collection<? extends org.tmapi.core.Topic> types)
          Returns all association roles typed by one of the given types.
 java.util.Collection<org.tmapi.core.Role> doGetRoles(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Role> doGetRoles(org.tmapi.core.Topic type)
          Return all roles of the given type within the given range.
protected  java.util.Collection<org.tmapi.core.Topic> doGetRoleTypes()
          Return all role types of the topic map within the given range.
 java.util.Collection<org.tmapi.core.Topic> doGetTopics(java.util.Collection<org.tmapi.core.Topic> types)
          
 java.util.Collection<org.tmapi.core.Topic> doGetTopics(java.util.Collection<org.tmapi.core.Topic> types, boolean all)
          Returns all instances of at least one given type or of every given topic type.
 java.util.Collection<org.tmapi.core.Topic> doGetTopics(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Topic> doGetTopics(org.tmapi.core.Topic type)
          Returns all topic instances of the given topic type within the given range.
 java.util.Collection<org.tmapi.core.Topic> doGetTopics(org.tmapi.core.Topic[] types, boolean all)
          
protected  java.util.Collection<org.tmapi.core.Topic> doGetTopicTypes()
          Returns all topic types of the topic map.
private  de.topicmapslab.majortom.model.index.ISupertypeSubtypeIndex getSupertypeSubtypeIndex()
          Internal utility method to return the supertype-subtype index
private  de.topicmapslab.majortom.model.index.ITypeInstanceIndex getTypeInstanceIndex()
          Internal utility method to return the type-instance index
 
Methods inherited from class de.topicmapslab.majortom.index.nonpaged.CachedTypeInstanceIndexImpl
getAssociations, getAssociations, getAssociations, getAssociationTypes, getCharacteristics, getCharacteristics, getCharacteristics, getCharacteristicTypes, getNames, getNames, getNames, getNameTypes, getOccurrences, getOccurrences, getOccurrences, getOccurrenceTypes, getRoles, getRoles, getRoles, getRoleTypes, getTopics, getTopics, getTopics, getTopics, getTopics, getTopicTypes
 
Methods inherited from class de.topicmapslab.majortom.index.core.BaseCachedTypeInstanceIndexImpl
cache, cache, cache, cache, cacheNumberOfConstructs, clear, clearCache, clearDependentCache, close, open, read, read, read, read, readNumberOfConstructs, topicMapChanged
 
Methods inherited from class de.topicmapslab.majortom.index.core.BaseCachedIndexImpl
isCachingEnabled, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext, isOnTransactionContext
 
Methods inherited from class de.topicmapslab.majortom.index.IndexImpl
getTopicMapStore, isAutoUpdated, isOpen, reindex
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex
getAssociations, getAssociations, getCharacteristics, getCharacteristics, getCharacteristics, getCharacteristicTypes, getNames, getNames, getOccurrences, getOccurrences, getRoles, getRoles, getTopics, getTopics, getTopics
 
Methods inherited from interface org.tmapi.index.TypeInstanceIndex
getAssociations, getAssociationTypes, getNames, getNameTypes, getOccurrences, getOccurrenceTypes, getRoles, getRoleTypes, getTopics, getTopics, getTopicTypes
 
Methods inherited from interface de.topicmapslab.majortom.model.index.IIndex
clear
 
Methods inherited from interface org.tmapi.index.Index
close, isAutoUpdated, isOpen, open, reindex
 

Constructor Detail

CachedTransitiveTypeInstanceIndex

public CachedTransitiveTypeInstanceIndex(T store)
constructor

Parameters:
store - the parent i
Method Detail

getSupertypeSubtypeIndex

private de.topicmapslab.majortom.model.index.ISupertypeSubtypeIndex getSupertypeSubtypeIndex()
Internal utility method to return the supertype-subtype index

Returns:
the index

getTypeInstanceIndex

private de.topicmapslab.majortom.model.index.ITypeInstanceIndex getTypeInstanceIndex()
Internal utility method to return the type-instance index

Returns:
the index

doGetAssociations

public java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic... types)


doGetAssociations

public java.util.Collection<org.tmapi.core.Association> doGetAssociations(java.util.Collection<? extends org.tmapi.core.Topic> types)
Returns all association items typed by one of the given types.

Specified by:
doGetAssociations in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
types - the topic types
Returns:
a Collection of all association items typed by one of the given types within the given range

doGetAssociations

public java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic type)
Return all associations of the given type within the given range

Specified by:
doGetAssociations in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
type - the type
Returns:
all associations of the type within the given range

doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(org.tmapi.core.Topic type)
Returns all characteristics being typed by the given of topic type.

Specified by:
doGetCharacteristics in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
type - the topic type
Returns:
a Collection of all characteristics typed by the given type within the given range

doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(org.tmapi.core.Topic... types)


doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.util.Collection<? extends org.tmapi.core.Topic> types)
Returns all characteristics typed by one of given types.

Specified by:
doGetCharacteristics in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
types - the topic types
Returns:
a Collection of all characteristics typed by one of the given types within the given range

doGetRoles

public java.util.Collection<org.tmapi.core.Role> doGetRoles(org.tmapi.core.Topic... types)


doGetRoles

public java.util.Collection<org.tmapi.core.Role> doGetRoles(org.tmapi.core.Topic type)
Return all roles of the given type within the given range.

Specified by:
doGetRoles in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
type - the role type
Returns:
all roles of the given type within the given range

doGetRoles

public java.util.Collection<org.tmapi.core.Role> doGetRoles(java.util.Collection<? extends org.tmapi.core.Topic> types)
Returns all association roles typed by one of the given types.

Specified by:
doGetRoles in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
types - the topic types
Returns:
a Collection of all association roles typed by one of the given types within the given range

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic type)
Return all names of the given type within the given range.

Specified by:
doGetNames in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
type - the type
Returns:
all names of the given type within the given range.

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic... types)


doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(java.util.Collection<? extends org.tmapi.core.Topic> types)
Returns all names typed by one of the given types.

Specified by:
doGetNames in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
types - the topic types
Returns:
a Collection of all names typed by one of the given types within the given range

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic type)
Return all occurrences of the given type within the given range.

Specified by:
doGetOccurrences in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
type - the type
Returns:
all occurrences of the given type within the given range.

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic... types)


doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.util.Collection<? extends org.tmapi.core.Topic> types)
Returns all occurrences typed by one of the given types.

Specified by:
doGetOccurrences in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
types - the topic types
Returns:
a Collection of all occurrences typed by one of the given types within the given range

doGetTopics

public java.util.Collection<org.tmapi.core.Topic> doGetTopics(org.tmapi.core.Topic... types)


doGetTopics

public java.util.Collection<org.tmapi.core.Topic> doGetTopics(java.util.Collection<org.tmapi.core.Topic> types)


doGetTopics

public java.util.Collection<org.tmapi.core.Topic> doGetTopics(java.util.Collection<org.tmapi.core.Topic> types,
                                                              boolean all)
Returns all instances of at least one given type or of every given topic type.

Specified by:
doGetTopics in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
types - the topic types
all - flag indicates if the found instances should be typed by every given type
Returns:
a Collection of all instances typed by at least one or every of the given types within the given range

doGetTopics

public java.util.Collection<org.tmapi.core.Topic> doGetTopics(org.tmapi.core.Topic type)
Returns all topic instances of the given topic type within the given range.

Specified by:
doGetTopics in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Parameters:
type - the type
Returns:
the topic within the given range

doGetTopics

public java.util.Collection<org.tmapi.core.Topic> doGetTopics(org.tmapi.core.Topic[] types,
                                                              boolean all)


doGetTopicTypes

protected java.util.Collection<org.tmapi.core.Topic> doGetTopicTypes()
Returns all topic types of the topic map.

Specified by:
doGetTopicTypes in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Returns:
the topic types within the given range

doGetAssociationTypes

protected java.util.Collection<org.tmapi.core.Topic> doGetAssociationTypes()
Returns all association types of the topic map.

Specified by:
doGetAssociationTypes in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Returns:
the association types within the given range

doGetRoleTypes

protected java.util.Collection<org.tmapi.core.Topic> doGetRoleTypes()
Return all role types of the topic map within the given range.

Specified by:
doGetRoleTypes in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Returns:
all role types of the topic map within the given range.

doGetCharacteristicTypes

protected java.util.Collection<org.tmapi.core.Topic> doGetCharacteristicTypes()
Returns all characteristic types contained by the topic map.

Specified by:
doGetCharacteristicTypes in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Returns:
a Collection of all types within the given range

doGetNameTypes

protected java.util.Collection<org.tmapi.core.Topic> doGetNameTypes()
Return all name types of the topic map within the given range.

Specified by:
doGetNameTypes in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Returns:
all name types within the given range

doGetOccurrenceTypes

protected java.util.Collection<org.tmapi.core.Topic> doGetOccurrenceTypes()
Return all occurrence types of the topic map within the given range.

Specified by:
doGetOccurrenceTypes in class CachedTypeInstanceIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
Returns:
all occurrence types within the given range