de.topicmapslab.majortom.database.jdbc.index
Class JdbcScopedIndex

java.lang.Object
  extended by de.topicmapslab.majortom.index.IndexImpl<T>
      extended by de.topicmapslab.majortom.index.core.BaseCachedIndexImpl<T>
          extended by de.topicmapslab.majortom.index.core.BaseCachedScopeIndexImpl<T>
              extended by de.topicmapslab.majortom.index.nonpaged.CachedScopeIndexImpl<JdbcTopicMapStore>
                  extended by de.topicmapslab.majortom.database.jdbc.index.JdbcScopedIndex
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, de.topicmapslab.majortom.model.index.IIndex, de.topicmapslab.majortom.model.index.IScopedIndex, org.tmapi.index.Index, org.tmapi.index.ScopedIndex

public class JdbcScopedIndex
extends CachedScopeIndexImpl<JdbcTopicMapStore>

Author:
Sven Krosse

Constructor Summary
JdbcScopedIndex(JdbcTopicMapStore store)
           
 
Method Summary
 java.util.Collection<org.tmapi.core.Association> doGetAssociations(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
          Returns all association items scoped by one of the given scope objects.
 java.util.Collection<org.tmapi.core.Association> doGetAssociations(de.topicmapslab.majortom.model.core.IScope scope)
          Returns all association items scoped by the given scope object.
 java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic theme)
          Returning all associations in the scope containing the given theme.
 java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic[] themes, boolean all)
          Returning all associations in the scope containing the given themes.
 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetAssociationScopes()
          Returns all scope objects used as scope of an association item.
 java.util.Collection<org.tmapi.core.Topic> doGetAssociationThemes()
          Returning all themes contained by at least one association scope.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
          Returns all characteristics scoped by one of the given scope objects.
 java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(de.topicmapslab.majortom.model.core.IScope scope)
          Returns all characteristics scoped by the given scope object.
 java.util.Collection<org.tmapi.core.Name> doGetNames(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
          Return all names scoped by one of the given scope objects
 java.util.Collection<org.tmapi.core.Name> doGetNames(de.topicmapslab.majortom.model.core.IScope scope)
          Return all names scoped by the given scope object
 java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic theme)
          Returning all names in the scope containing the given theme.
 java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic[] themes, boolean all)
          Returning all names in the scope containing the given themes.
 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetNameScopes()
          Returns all scope objects used as scope of a name item.
 java.util.Collection<org.tmapi.core.Topic> doGetNameThemes()
          Returning all themes contained by at least one name scope.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
          Return all occurrences scoped by one of the given scope objects
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(de.topicmapslab.majortom.model.core.IScope scope)
          Return all occurrences scoped by the given scope object
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic theme)
          Returning all occurrences in the scope containing the given theme.
 java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic[] themes, boolean all)
          Returning all occurrences in the scope containing the given themes.
 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetOccurrenceScopes()
          Returns all scope objects used as scope of an occurrence item.
 java.util.Collection<org.tmapi.core.Topic> doGetOccurrenceThemes()
          Returning all themes contained by at least one occurrence scope.
 java.util.Collection<org.tmapi.core.Scoped> doGetScopables(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
          Returns all constructs scoped by one of the given scope object.
 java.util.Collection<org.tmapi.core.Scoped> doGetScopables(de.topicmapslab.majortom.model.core.IScope scope)
          Returns all constructs scoped by the given scope object.
 de.topicmapslab.majortom.model.core.IScope doGetScope(java.util.Collection<? extends org.tmapi.core.Topic> themes)
          Returns the scope of the given themes
 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetScopes(java.util.Collection<? extends org.tmapi.core.Topic> themes, boolean matchAll)
          Returns the scopes of the given themes
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
          Return all variants scoped by one of the given scope objects
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(de.topicmapslab.majortom.model.core.IScope... scopes)
          
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(de.topicmapslab.majortom.model.core.IScope scope)
          Return all variants scoped by the given scope object
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(org.tmapi.core.Topic theme)
          Returning all variants in the scope containing the given theme.
 java.util.Collection<org.tmapi.core.Variant> doGetVariants(org.tmapi.core.Topic[] themes, boolean all)
          Returning all variants in the scope containing the given themes.
 java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetVariantScopes()
          Returns all scope objects used as scope of a variant item.
 java.util.Collection<org.tmapi.core.Topic> doGetVariantThemes()
          Returning all themes contained by at least one variant scope.
 
Methods inherited from class de.topicmapslab.majortom.index.nonpaged.CachedScopeIndexImpl
getAssociations, getAssociations, getAssociations, getAssociations, getAssociations, getAssociationScopes, getAssociationThemes, getCharacteristics, getCharacteristics, getNames, getNames, getNames, getNames, getNames, getNameScopes, getNameThemes, getOccurrences, getOccurrences, getOccurrences, getOccurrences, getOccurrences, getOccurrenceScopes, getOccurrenceThemes, getScopables, getScopables, getScope, getScope, getScopes, getScopes, getScopes, getVariants, getVariants, getVariants, getVariants, getVariants, getVariantScopes, getVariantThemes
 
Methods inherited from class de.topicmapslab.majortom.index.core.BaseCachedScopeIndexImpl
cache, cache, cacheNumberOfConstructs, cacheScope, cacheScopes, cacheScopes, cacheScopes, cacheScopes, cacheThemes, cacheThemes, clear, clearCache, close, generateScopesCacheKey, generateScopesCacheKey, generateScopesCacheKey, generateScopesCacheKey, generateScopesCacheKey, generateScopesCacheKey, open, read, read, readNumberOfConstructs, readScope, readScopes, readScopes, readScopes, readScopes, readThemes, readThemes, 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

JdbcScopedIndex

public JdbcScopedIndex(JdbcTopicMapStore store)
Parameters:
store -
Method Detail

doGetAssociationScopes

public java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetAssociationScopes()
Returns all scope objects used as scope of an association item. Default implementation only calls the parent index.

Specified by:
doGetAssociationScopes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
a Collection of scope objects

doGetAssociations

public java.util.Collection<org.tmapi.core.Association> doGetAssociations(de.topicmapslab.majortom.model.core.IScope scope)
Returns all association items scoped by the given scope object.

Specified by:
doGetAssociations in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scope - the scope
Returns:
a collection of all association items scoped by the given scope

doGetAssociations

public java.util.Collection<org.tmapi.core.Association> doGetAssociations(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
Returns all association items scoped by one of the given scope objects.

Specified by:
doGetAssociations in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scopes - the scopes
Returns:
a Collection of all association items scoped by one of the given scopes

doGetAssociationThemes

public java.util.Collection<org.tmapi.core.Topic> doGetAssociationThemes()
Returning all themes contained by at least one association scope. Default implementation only calls the parent index.

Specified by:
doGetAssociationThemes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
all themes contained by at least one association scope.

doGetAssociations

public java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic theme)
Returning all associations in the scope containing the given theme.

Specified by:
doGetAssociations in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
theme - the theme
Returns:
all associations

doGetAssociations

public java.util.Collection<org.tmapi.core.Association> doGetAssociations(org.tmapi.core.Topic[] themes,
                                                                          boolean all)
Returning all associations in the scope containing the given themes.

Specified by:
doGetAssociations in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
themes - the themes
all - flag indicates if all themes have to be contained
Returns:
all associations

doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(de.topicmapslab.majortom.model.core.IScope scope)
Returns all characteristics scoped by the given scope object.

Specified by:
doGetCharacteristics in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scope - the scope
Returns:
a Collection of all characteristics scoped by the given scope

doGetCharacteristics

public java.util.Collection<de.topicmapslab.majortom.model.core.ICharacteristics> doGetCharacteristics(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
Returns all characteristics scoped by one of the given scope objects.

Specified by:
doGetCharacteristics in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scopes - the scopes
Returns:
a Collection of all characteristics scoped by one of the given scope objects.

doGetNameScopes

public java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetNameScopes()
Returns all scope objects used as scope of a name item.

Specified by:
doGetNameScopes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
a collection of scope objects

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(de.topicmapslab.majortom.model.core.IScope scope)
Return all names scoped by the given scope object

Specified by:
doGetNames in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scope - the scope object
Returns:
all names scoped by the given scope object

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
Return all names scoped by one of the given scope objects

Specified by:
doGetNames in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scopes - the scope objects
Returns:
all names scoped by one of the given scope objects

doGetNameThemes

public java.util.Collection<org.tmapi.core.Topic> doGetNameThemes()
Returning all themes contained by at least one name scope.

Specified by:
doGetNameThemes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
all themes contained by at least one name scope.

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic theme)
Returning all names in the scope containing the given theme.

Specified by:
doGetNames in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
theme - the theme
Returns:
all names

doGetNames

public java.util.Collection<org.tmapi.core.Name> doGetNames(org.tmapi.core.Topic[] themes,
                                                            boolean all)
Returning all names in the scope containing the given themes.

Specified by:
doGetNames in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
themes - the themes
all - flag indicates if all themes have to be contained
Returns:
all names

doGetOccurrenceScopes

public java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetOccurrenceScopes()
Returns all scope objects used as scope of an occurrence item.

Specified by:
doGetOccurrenceScopes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
a Collection of scope objects

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(de.topicmapslab.majortom.model.core.IScope scope)
Return all occurrences scoped by the given scope object

Specified by:
doGetOccurrences in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scope - the scope object
Returns:
all occurrences scoped by the given scope object within the given range

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
Return all occurrences scoped by one of the given scope objects

Specified by:
doGetOccurrences in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scopes - the scope objects
Returns:
all occurrences scoped by one of the given scope objects

doGetOccurrenceThemes

public java.util.Collection<org.tmapi.core.Topic> doGetOccurrenceThemes()
Returning all themes contained by at least one occurrence scope.

Specified by:
doGetOccurrenceThemes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
all themes contained by at least one occurrence scope.

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic theme)
Returning all occurrences in the scope containing the given theme.

Specified by:
doGetOccurrences in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
theme - the theme
Returns:
all occurrences

doGetOccurrences

public java.util.Collection<org.tmapi.core.Occurrence> doGetOccurrences(org.tmapi.core.Topic[] themes,
                                                                        boolean all)
Returning all occurrences in the scope containing the given themes.

Specified by:
doGetOccurrences in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
themes - the themes
all - flag indicates if all themes have to be contained
Returns:
all occurrences

doGetScopables

public java.util.Collection<org.tmapi.core.Scoped> doGetScopables(de.topicmapslab.majortom.model.core.IScope scope)
Returns all constructs scoped by the given scope object.

Specified by:
doGetScopables in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scope - the scope
Returns:
a Collection of all constructs scoped by the given scope

doGetScopables

public java.util.Collection<org.tmapi.core.Scoped> doGetScopables(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
Returns all constructs scoped by one of the given scope object.

Specified by:
doGetScopables in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
a Collection of all constructs scoped by one of the given scope object.

doGetScope

public de.topicmapslab.majortom.model.core.IScope doGetScope(java.util.Collection<? extends org.tmapi.core.Topic> themes)
Returns the scope of the given themes

Specified by:
doGetScope in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
themes - the themes
Returns:
the scope object and never null

doGetScopes

public java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetScopes(java.util.Collection<? extends org.tmapi.core.Topic> themes,
                                                                                    boolean matchAll)
Returns the scopes of the given themes

Specified by:
doGetScopes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
themes - the themes
matchAll - flag indicates if the returned scopes has to contain all themes
Returns:
the set of scope object and never null

doGetVariantScopes

public java.util.Collection<de.topicmapslab.majortom.model.core.IScope> doGetVariantScopes()
Returns all scope objects used as scope of a variant item.

Specified by:
doGetVariantScopes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
a collection of scope objects

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(de.topicmapslab.majortom.model.core.IScope scope)
Return all variants scoped by the given scope object

Specified by:
doGetVariants in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scope - the scope object
Returns:
all variants scoped by the given scope object

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(de.topicmapslab.majortom.model.core.IScope... scopes)


doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(java.util.Collection<de.topicmapslab.majortom.model.core.IScope> scopes)
Return all variants scoped by one of the given scope objects

Specified by:
doGetVariants in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
scopes - the scope objects
Returns:
all variants scoped by one of the given scope objects

doGetVariantThemes

public java.util.Collection<org.tmapi.core.Topic> doGetVariantThemes()
Returning all themes contained by at least one variant scope.

Specified by:
doGetVariantThemes in class CachedScopeIndexImpl<JdbcTopicMapStore>
Returns:
all themes contained by at least one variant scope.

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(org.tmapi.core.Topic theme)
Returning all variants in the scope containing the given theme.

Specified by:
doGetVariants in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
theme - the theme
Returns:
all variants

doGetVariants

public java.util.Collection<org.tmapi.core.Variant> doGetVariants(org.tmapi.core.Topic[] themes,
                                                                  boolean all)
Returning all variants in the scope containing the given themes.

Specified by:
doGetVariants in class CachedScopeIndexImpl<JdbcTopicMapStore>
Parameters:
themes - the themes
all - flag indicates if all themes have to be contained
Returns:
all variants