de.topicmapslab.majortom.index.paged
Class PagedIdentityIndexImpl<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<T>
          extended by de.topicmapslab.majortom.index.core.BaseCachedIdentityIndexImpl<T>
              extended by de.topicmapslab.majortom.index.paged.PagedIdentityIndexImpl<T>
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, de.topicmapslab.majortom.model.index.IIndex, de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex, org.tmapi.index.Index
Direct Known Subclasses:
InMemoryPagedIdentityIndex, JdbcPagedIdentityIndex, PagedRedisIdentityIndex

public abstract class PagedIdentityIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>
extends BaseCachedIdentityIndexImpl<T>
implements de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

Implementation of IIdentityIndex

Author:
Sven Krosse

Nested Class Summary
 
Nested classes/interfaces inherited from class de.topicmapslab.majortom.index.core.BaseCachedIdentityIndexImpl
BaseCachedIdentityIndexImpl.Type
 
Field Summary
private  de.topicmapslab.majortom.model.index.IIdentityIndex parentIndex
           
 
Constructor Summary
PagedIdentityIndexImpl(T store, de.topicmapslab.majortom.model.index.IIdentityIndex parentIndex)
          constructor
 
Method Summary
protected  java.util.List<org.tmapi.core.Construct> doGetConstructsByIdentifier(java.util.regex.Pattern regExp, int offset, int limit)
          Returning all constructs using an identifier matching the given regular expression.
protected  java.util.List<org.tmapi.core.Construct> doGetConstructsByIdentifier(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Construct> comparator)
          Returning all constructs using an identifier matching the given regular expression.
protected  java.util.List<org.tmapi.core.Construct> doGetConstructsByItemIdentifier(java.util.regex.Pattern regExp, int offset, int limit)
          Returning all constructs using an item-identifier matching the given regular expression.
protected  java.util.List<org.tmapi.core.Construct> doGetConstructsByItemIdentifier(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Construct> comparator)
          Returning all constructs using an item-identifier matching the given regular expression.
protected  java.util.List<org.tmapi.core.Locator> doGetItemIdentifiers(int offset, int limit)
          Return all item-identifiers used by any construct of the topic map.
protected  java.util.List<org.tmapi.core.Locator> doGetItemIdentifiers(int offset, int limit, java.util.Comparator<org.tmapi.core.Locator> comparator)
          Return all item-identifiers used by any construct of the topic map.
protected  long doGetNumberOfItemIdentifiers()
          Returns the number of item-identifiers in the topic map
protected  long doGetNumberOfSubjectIdentifiers()
          Returns the number of subject-identifiers in the topic map
protected  long doGetNumberOfSubjectLocators()
          Returns the number of subject-locators in the topic map
protected  java.util.List<org.tmapi.core.Locator> doGetSubjectIdentifiers(int offset, int limit)
          Return all subject-identifiers used by any topic of the topic map.
protected  java.util.List<org.tmapi.core.Locator> doGetSubjectIdentifiers(int offset, int limit, java.util.Comparator<org.tmapi.core.Locator> comparator)
          Return all subject-identifiers used by any topic of the topic map.
protected  java.util.List<org.tmapi.core.Locator> doGetSubjectLocators(int offset, int limit)
          Return all subject-locators used by any topic of the topic map.
protected  java.util.List<org.tmapi.core.Locator> doGetSubjectLocators(int offset, int limit, java.util.Comparator<org.tmapi.core.Locator> comparator)
          Return all subject-locators used by any topic of the topic map.
protected  java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectIdentifier(java.util.regex.Pattern regExp, int offset, int limit)
          Returning all topics using a subject-identifier matching the given regular expression.
protected  java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectIdentifier(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          Returning all topics using a subject-identifier matching the given regular expression.
protected  java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectLocator(java.util.regex.Pattern regExp, int offset, int limit)
          Returning all topics using a subject-locator matching the given regular expression.
protected  java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectLocator(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          Returning all topics using a subject-locator matching the given regular expression.
 java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.util.regex.Pattern regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Construct> comparator)
          
 java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.lang.String regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.lang.String regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Construct> comparator)
          
 java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.util.regex.Pattern regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Construct> comparator)
          
 java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.lang.String regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.lang.String regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Construct> comparator)
          
 java.util.List<org.tmapi.core.Locator> getItemIdentifiers(int offset, int limit)
          
 java.util.List<org.tmapi.core.Locator> getItemIdentifiers(int offset, int limit, java.util.Comparator<org.tmapi.core.Locator> comparator)
          
 long getNumberOfItemIdentifiers()
          
 long getNumberOfSubjectIdentifiers()
          
 long getNumberOfSubjectLocators()
          
 de.topicmapslab.majortom.model.index.IIdentityIndex getParentIndex()
           
 java.util.List<org.tmapi.core.Locator> getSubjectIdentifiers(int offset, int limit)
          
 java.util.List<org.tmapi.core.Locator> getSubjectIdentifiers(int offset, int limit, java.util.Comparator<org.tmapi.core.Locator> comparator)
          
 java.util.List<org.tmapi.core.Locator> getSubjectLocators(int offset, int limit)
          
 java.util.List<org.tmapi.core.Locator> getSubjectLocators(int offset, int limit, java.util.Comparator<org.tmapi.core.Locator> comparator)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.util.regex.Pattern regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.lang.String regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.lang.String regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.util.regex.Pattern regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.util.regex.Pattern regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.lang.String regExp, int offset, int limit)
          
 java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.lang.String regExp, int offset, int limit, java.util.Comparator<org.tmapi.core.Topic> comparator)
          
 void open()
          
 
Methods inherited from class de.topicmapslab.majortom.index.core.BaseCachedIdentityIndexImpl
cache, cache, cache, cacheLocators, cacheLocators, cacheLocators, cacheLocators, clear, clearCache, close, read, read, read, readLocators, readLocators, readLocators, readLocators, 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, reindex
 

Field Detail

parentIndex

private final de.topicmapslab.majortom.model.index.IIdentityIndex parentIndex
Constructor Detail

PagedIdentityIndexImpl

public PagedIdentityIndexImpl(T store,
                              de.topicmapslab.majortom.model.index.IIdentityIndex parentIndex)
constructor

Parameters:
store - the store
parentIndex - the parent index
Method Detail

getParentIndex

public de.topicmapslab.majortom.model.index.IIdentityIndex getParentIndex()
Returns:
the parentIndex

getConstructsByIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.lang.String regExp,
                                                                          int offset,
                                                                          int limit)

Specified by:
getConstructsByIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getConstructsByIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.lang.String regExp,
                                                                          int offset,
                                                                          int limit,
                                                                          java.util.Comparator<org.tmapi.core.Construct> comparator)

Specified by:
getConstructsByIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getConstructsByIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.util.regex.Pattern regExp,
                                                                          int offset,
                                                                          int limit)

Specified by:
getConstructsByIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getConstructsByIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByIdentifier(java.util.regex.Pattern regExp,
                                                                          int offset,
                                                                          int limit,
                                                                          java.util.Comparator<org.tmapi.core.Construct> comparator)

Specified by:
getConstructsByIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getConstructsByItemIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.lang.String regExp,
                                                                              int offset,
                                                                              int limit)

Specified by:
getConstructsByItemIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getConstructsByItemIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.lang.String regExp,
                                                                              int offset,
                                                                              int limit,
                                                                              java.util.Comparator<org.tmapi.core.Construct> comparator)

Specified by:
getConstructsByItemIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getConstructsByItemIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.util.regex.Pattern regExp,
                                                                              int offset,
                                                                              int limit)

Specified by:
getConstructsByItemIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getConstructsByItemIdentifier

public java.util.List<org.tmapi.core.Construct> getConstructsByItemIdentifier(java.util.regex.Pattern regExp,
                                                                              int offset,
                                                                              int limit,
                                                                              java.util.Comparator<org.tmapi.core.Construct> comparator)

Specified by:
getConstructsByItemIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getItemIdentifiers

public java.util.List<org.tmapi.core.Locator> getItemIdentifiers(int offset,
                                                                 int limit)

Specified by:
getItemIdentifiers in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getItemIdentifiers

public java.util.List<org.tmapi.core.Locator> getItemIdentifiers(int offset,
                                                                 int limit,
                                                                 java.util.Comparator<org.tmapi.core.Locator> comparator)

Specified by:
getItemIdentifiers in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getNumberOfItemIdentifiers

public long getNumberOfItemIdentifiers()

Specified by:
getNumberOfItemIdentifiers in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getSubjectIdentifiers

public java.util.List<org.tmapi.core.Locator> getSubjectIdentifiers(int offset,
                                                                    int limit)

Specified by:
getSubjectIdentifiers in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getSubjectIdentifiers

public java.util.List<org.tmapi.core.Locator> getSubjectIdentifiers(int offset,
                                                                    int limit,
                                                                    java.util.Comparator<org.tmapi.core.Locator> comparator)

Specified by:
getSubjectIdentifiers in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getNumberOfSubjectIdentifiers

public long getNumberOfSubjectIdentifiers()

Specified by:
getNumberOfSubjectIdentifiers in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getSubjectLocators

public java.util.List<org.tmapi.core.Locator> getSubjectLocators(int offset,
                                                                 int limit)

Specified by:
getSubjectLocators in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getSubjectLocators

public java.util.List<org.tmapi.core.Locator> getSubjectLocators(int offset,
                                                                 int limit,
                                                                 java.util.Comparator<org.tmapi.core.Locator> comparator)

Specified by:
getSubjectLocators in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getNumberOfSubjectLocators

public long getNumberOfSubjectLocators()

Specified by:
getNumberOfSubjectLocators in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectIdentifier

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.lang.String regExp,
                                                                         int offset,
                                                                         int limit)

Specified by:
getTopicsBySubjectIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectIdentifier

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.lang.String regExp,
                                                                         int offset,
                                                                         int limit,
                                                                         java.util.Comparator<org.tmapi.core.Topic> comparator)

Specified by:
getTopicsBySubjectIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectIdentifier

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.util.regex.Pattern regExp,
                                                                         int offset,
                                                                         int limit)

Specified by:
getTopicsBySubjectIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectIdentifier

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectIdentifier(java.util.regex.Pattern regExp,
                                                                         int offset,
                                                                         int limit,
                                                                         java.util.Comparator<org.tmapi.core.Topic> comparator)

Specified by:
getTopicsBySubjectIdentifier in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectLocator

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.lang.String regExp,
                                                                      int offset,
                                                                      int limit)

Specified by:
getTopicsBySubjectLocator in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectLocator

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.lang.String regExp,
                                                                      int offset,
                                                                      int limit,
                                                                      java.util.Comparator<org.tmapi.core.Topic> comparator)

Specified by:
getTopicsBySubjectLocator in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectLocator

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.util.regex.Pattern regExp,
                                                                      int offset,
                                                                      int limit)

Specified by:
getTopicsBySubjectLocator in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

getTopicsBySubjectLocator

public java.util.List<org.tmapi.core.Topic> getTopicsBySubjectLocator(java.util.regex.Pattern regExp,
                                                                      int offset,
                                                                      int limit,
                                                                      java.util.Comparator<org.tmapi.core.Topic> comparator)

Specified by:
getTopicsBySubjectLocator in interface de.topicmapslab.majortom.model.index.paging.IPagedIdentityIndex

open

public void open()

Specified by:
open in interface org.tmapi.index.Index
Overrides:
open in class BaseCachedIdentityIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore>

doGetConstructsByIdentifier

protected java.util.List<org.tmapi.core.Construct> doGetConstructsByIdentifier(java.util.regex.Pattern regExp,
                                                                               int offset,
                                                                               int limit)
Returning all constructs using an identifier matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
Returns:
the constructs

doGetConstructsByIdentifier

protected java.util.List<org.tmapi.core.Construct> doGetConstructsByIdentifier(java.util.regex.Pattern regExp,
                                                                               int offset,
                                                                               int limit,
                                                                               java.util.Comparator<org.tmapi.core.Construct> comparator)
Returning all constructs using an identifier matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
comparator - the comparator to sort the values
Returns:
the constructs

doGetConstructsByItemIdentifier

protected java.util.List<org.tmapi.core.Construct> doGetConstructsByItemIdentifier(java.util.regex.Pattern regExp,
                                                                                   int offset,
                                                                                   int limit)
Returning all constructs using an item-identifier matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
Returns:
the constructs

doGetConstructsByItemIdentifier

protected java.util.List<org.tmapi.core.Construct> doGetConstructsByItemIdentifier(java.util.regex.Pattern regExp,
                                                                                   int offset,
                                                                                   int limit,
                                                                                   java.util.Comparator<org.tmapi.core.Construct> comparator)
Returning all constructs using an item-identifier matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
comparator - the comparator to sort the values
Returns:
the constructs

doGetTopicsBySubjectIdentifier

protected java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectIdentifier(java.util.regex.Pattern regExp,
                                                                              int offset,
                                                                              int limit)
Returning all topics using a subject-identifier matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
Returns:
the topics

doGetTopicsBySubjectIdentifier

protected java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectIdentifier(java.util.regex.Pattern regExp,
                                                                              int offset,
                                                                              int limit,
                                                                              java.util.Comparator<org.tmapi.core.Topic> comparator)
Returning all topics using a subject-identifier matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
comparator - the comparator to sort the values
Returns:
the topics

doGetTopicsBySubjectLocator

protected java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectLocator(java.util.regex.Pattern regExp,
                                                                           int offset,
                                                                           int limit)
Returning all topics using a subject-locator matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
Returns:
the topics

doGetTopicsBySubjectLocator

protected java.util.List<org.tmapi.core.Topic> doGetTopicsBySubjectLocator(java.util.regex.Pattern regExp,
                                                                           int offset,
                                                                           int limit,
                                                                           java.util.Comparator<org.tmapi.core.Topic> comparator)
Returning all topics using a subject-locator matching the given regular expression.

Parameters:
regExp - the regular expression
offset - the offset value
limit - the limit value
comparator - the comparator to sort the values
Returns:
the topics

doGetItemIdentifiers

protected java.util.List<org.tmapi.core.Locator> doGetItemIdentifiers(int offset,
                                                                      int limit)
Return all item-identifiers used by any construct of the topic map.

Parameters:
offset - the offset value
limit - the limit value
Returns:
the locators

doGetItemIdentifiers

protected java.util.List<org.tmapi.core.Locator> doGetItemIdentifiers(int offset,
                                                                      int limit,
                                                                      java.util.Comparator<org.tmapi.core.Locator> comparator)
Return all item-identifiers used by any construct of the topic map.

Parameters:
offset - the offset value
limit - the limit value
comparator - the comparator to sort the values
Returns:
the locators

doGetNumberOfItemIdentifiers

protected long doGetNumberOfItemIdentifiers()
Returns the number of item-identifiers in the topic map

Returns:
the number

doGetSubjectIdentifiers

protected java.util.List<org.tmapi.core.Locator> doGetSubjectIdentifiers(int offset,
                                                                         int limit)
Return all subject-identifiers used by any topic of the topic map.

Parameters:
offset - the offset value
limit - the limit value
Returns:
the locators

doGetSubjectIdentifiers

protected java.util.List<org.tmapi.core.Locator> doGetSubjectIdentifiers(int offset,
                                                                         int limit,
                                                                         java.util.Comparator<org.tmapi.core.Locator> comparator)
Return all subject-identifiers used by any topic of the topic map.

Parameters:
offset - the offset value
limit - the limit value
comparator - the comparator to sort the values
Returns:
the locators

doGetNumberOfSubjectIdentifiers

protected long doGetNumberOfSubjectIdentifiers()
Returns the number of subject-identifiers in the topic map

Returns:
the number

doGetSubjectLocators

protected java.util.List<org.tmapi.core.Locator> doGetSubjectLocators(int offset,
                                                                      int limit)
Return all subject-locators used by any topic of the topic map.

Parameters:
offset - the offset value
limit - the limit value
Returns:
the locators

doGetSubjectLocators

protected java.util.List<org.tmapi.core.Locator> doGetSubjectLocators(int offset,
                                                                      int limit,
                                                                      java.util.Comparator<org.tmapi.core.Locator> comparator)
Return all subject-locators used by any topic of the topic map.

Parameters:
offset - the offset value
limit - the limit value
comparator - the comparator to sort the values
Returns:
the locators

doGetNumberOfSubjectLocators

protected long doGetNumberOfSubjectLocators()
Returns the number of subject-locators in the topic map

Returns:
the number