de.topicmapslab.majortom.index.nonpaged
Class CachedTypeInstanceIndexImpl<E 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<E>
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, de.topicmapslab.majortom.model.index.IIndex, de.topicmapslab.majortom.model.index.ITypeInstanceIndex, org.tmapi.index.Index, org.tmapi.index.TypeInstanceIndex
Direct Known Subclasses:
CachedTransitiveTypeInstanceIndex, JdbcTransitiveTypeInstanceIndex, JdbcTypeInstanceIndex

public abstract class CachedTypeInstanceIndexImpl<E extends de.topicmapslab.majortom.model.store.ITopicMapStore>
extends BaseCachedTypeInstanceIndexImpl<E>
implements de.topicmapslab.majortom.model.index.ITypeInstanceIndex

Implementation of the in-memory ITypeInstanceIndex supporting paging

Author:
Sven Krosse

Constructor Summary
CachedTypeInstanceIndexImpl(E store)
          constructor
 
Method Summary
protected abstract  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.
protected abstract  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 abstract  java.util.Collection<org.tmapi.core.Topic> doGetAssociationTypes()
          Returns all association types of the topic map.
protected abstract  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.
protected abstract  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 abstract  java.util.Collection<org.tmapi.core.Topic> doGetCharacteristicTypes()
          Returns all characteristic types contained by the topic map.
protected abstract  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.
protected abstract  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 abstract  java.util.Collection<org.tmapi.core.Topic> doGetNameTypes()
          Return all name types of the topic map within the given range.
protected abstract  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.
protected abstract  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 abstract  java.util.Collection<org.tmapi.core.Topic> doGetOccurrenceTypes()
          Return all occurrence types of the topic map within the given range.
protected abstract  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.
protected abstract  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 abstract  java.util.Collection<org.tmapi.core.Topic> doGetRoleTypes()
          Return all role types of the topic map within the given range.
protected abstract  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.
protected abstract  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.
protected abstract  java.util.Collection<org.tmapi.core.Topic> doGetTopicTypes()
          Returns all topic types of the topic map.
 java.util.Collection<org.tmapi.core.Association> getAssociations(java.util.Collection<? extends org.tmapi.core.Topic> types)
          
 java.util.Collection<org.tmapi.core.Association> getAssociations(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Association> getAssociations(org.tmapi.core.Topic type)
          
 java.util.Collection<org.tmapi.core.Topic> getAssociationTypes()
          
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> getCharacteristics(java.util.Collection<? extends org.tmapi.core.Topic> types)
          
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> getCharacteristics(org.tmapi.core.Topic... types)
          
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> getCharacteristics(org.tmapi.core.Topic type)
          
 java.util.Collection<org.tmapi.core.Topic> getCharacteristicTypes()
          
 java.util.Collection<org.tmapi.core.Name> getNames(java.util.Collection<? extends org.tmapi.core.Topic> types)
          
 java.util.Collection<org.tmapi.core.Name> getNames(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Name> getNames(org.tmapi.core.Topic type)
          
 java.util.Collection<org.tmapi.core.Topic> getNameTypes()
          
 java.util.Collection<org.tmapi.core.Occurrence> getOccurrences(java.util.Collection<? extends org.tmapi.core.Topic> types)
          
 java.util.Collection<org.tmapi.core.Occurrence> getOccurrences(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Occurrence> getOccurrences(org.tmapi.core.Topic type)
          
 java.util.Collection<org.tmapi.core.Topic> getOccurrenceTypes()
          
 java.util.Collection<org.tmapi.core.Role> getRoles(java.util.Collection<? extends org.tmapi.core.Topic> types)
          
 java.util.Collection<org.tmapi.core.Role> getRoles(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Role> getRoles(org.tmapi.core.Topic type)
          
 java.util.Collection<org.tmapi.core.Topic> getRoleTypes()
          
 java.util.Collection<org.tmapi.core.Topic> getTopics(java.util.Collection<org.tmapi.core.Topic> types)
          
 java.util.Collection<org.tmapi.core.Topic> getTopics(java.util.Collection<org.tmapi.core.Topic> types, boolean all)
          
 java.util.Collection<org.tmapi.core.Topic> getTopics(org.tmapi.core.Topic... types)
          
 java.util.Collection<org.tmapi.core.Topic> getTopics(org.tmapi.core.Topic type)
          
 java.util.Collection<org.tmapi.core.Topic> getTopics(org.tmapi.core.Topic[] types, boolean matchAll)
          
 java.util.Collection<org.tmapi.core.Topic> 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.IIndex
clear
 
Methods inherited from interface org.tmapi.index.Index
close, isAutoUpdated, isOpen, open, reindex
 

Constructor Detail

CachedTypeInstanceIndexImpl

public CachedTypeInstanceIndexImpl(E store)
constructor

Parameters:
store - the topic map store
Method Detail

getAssociationTypes

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

Specified by:
getAssociationTypes in interface org.tmapi.index.TypeInstanceIndex

getAssociations

public java.util.Collection<org.tmapi.core.Association> getAssociations(org.tmapi.core.Topic type)

Specified by:
getAssociations in interface org.tmapi.index.TypeInstanceIndex

getAssociations

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

Specified by:
getAssociations in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getAssociations

public java.util.Collection<org.tmapi.core.Association> getAssociations(java.util.Collection<? extends org.tmapi.core.Topic> types)

Specified by:
getAssociations in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getCharacteristicTypes

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

Specified by:
getCharacteristicTypes in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getCharacteristics

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

Specified by:
getCharacteristics in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getCharacteristics

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

Specified by:
getCharacteristics in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getCharacteristics

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

Specified by:
getCharacteristics in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getNameTypes

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

Specified by:
getNameTypes in interface org.tmapi.index.TypeInstanceIndex

getNames

public java.util.Collection<org.tmapi.core.Name> getNames(org.tmapi.core.Topic type)

Specified by:
getNames in interface org.tmapi.index.TypeInstanceIndex

getNames

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

Specified by:
getNames in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getNames

public java.util.Collection<org.tmapi.core.Name> getNames(java.util.Collection<? extends org.tmapi.core.Topic> types)

Specified by:
getNames in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getOccurrenceTypes

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

Specified by:
getOccurrenceTypes in interface org.tmapi.index.TypeInstanceIndex

getOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> getOccurrences(org.tmapi.core.Topic type)

Specified by:
getOccurrences in interface org.tmapi.index.TypeInstanceIndex

getOccurrences

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

Specified by:
getOccurrences in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> getOccurrences(java.util.Collection<? extends org.tmapi.core.Topic> types)

Specified by:
getOccurrences in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getRoleTypes

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

Specified by:
getRoleTypes in interface org.tmapi.index.TypeInstanceIndex

getRoles

public java.util.Collection<org.tmapi.core.Role> getRoles(org.tmapi.core.Topic type)

Specified by:
getRoles in interface org.tmapi.index.TypeInstanceIndex

getRoles

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

Specified by:
getRoles in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getRoles

public java.util.Collection<org.tmapi.core.Role> getRoles(java.util.Collection<? extends org.tmapi.core.Topic> types)

Specified by:
getRoles in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getTopicTypes

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

Specified by:
getTopicTypes in interface org.tmapi.index.TypeInstanceIndex

getTopics

public java.util.Collection<org.tmapi.core.Topic> getTopics(org.tmapi.core.Topic type)

Specified by:
getTopics in interface org.tmapi.index.TypeInstanceIndex

getTopics

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

Specified by:
getTopics in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getTopics

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

Specified by:
getTopics in interface org.tmapi.index.TypeInstanceIndex

getTopics

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

Specified by:
getTopics in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

getTopics

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

Specified by:
getTopics in interface de.topicmapslab.majortom.model.index.ITypeInstanceIndex

doGetTopicTypes

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

Returns:
the topic types within the given range

doGetTopics

protected abstract 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.

Parameters:
type - the type
Returns:
the topic within the given range

doGetTopics

protected abstract 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.

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

doGetAssociationTypes

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

Returns:
the association types within the given range

doGetAssociations

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

Parameters:
type - the type
Returns:
all associations of the type within the given range

doGetAssociations

protected abstract 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.

Parameters:
types - the topic types
Returns:
a Collection of all association items typed by one of the given types within the given range

doGetRoleTypes

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

Returns:
all role types of the topic map within the given range.

doGetRoles

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

Parameters:
type - the role type
Returns:
all roles of the given type within the given range

doGetRoles

protected abstract 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.

Parameters:
types - the topic types
Returns:
a Collection of all association roles typed by one of the given types within the given range

doGetCharacteristicTypes

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

Returns:
a Collection of all types within the given range

doGetCharacteristics

protected abstract 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.

Parameters:
type - the topic type
Returns:
a Collection of all characteristics typed by the given type within the given range

doGetCharacteristics

protected abstract 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.

Parameters:
types - the topic types
Returns:
a Collection of all characteristics typed by one of the given types within the given range

doGetNameTypes

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

Returns:
all name types within the given range

doGetNames

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

Parameters:
type - the type
Returns:
all names of the given type within the given range.

doGetNames

protected abstract 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.

Parameters:
types - the topic types
Returns:
a Collection of all names typed by one of the given types within the given range

doGetOccurrenceTypes

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

Returns:
all occurrence types within the given range

doGetOccurrences

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

Parameters:
type - the type
Returns:
all occurrences of the given type within the given range.

doGetOccurrences

protected abstract 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.

Parameters:
types - the topic types
Returns:
a Collection of all occurrences typed by one of the given types within the given range