de.topicmapslab.majortom.index.paged
Class PagedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore,E extends org.tmapi.index.Index>

java.lang.Object
  extended by de.topicmapslab.majortom.index.IndexImpl<T>
      extended by de.topicmapslab.majortom.index.paged.PagedIndexImpl<T,E>
Type Parameters:
T - the topic map store class
E - the type of the dependent parent index
All Implemented Interfaces:
de.topicmapslab.majortom.model.event.ITopicMapListener, org.tmapi.index.Index

public abstract class PagedIndexImpl<T extends de.topicmapslab.majortom.model.store.ITopicMapStore,E extends org.tmapi.index.Index>
extends IndexImpl<T>
implements de.topicmapslab.majortom.model.event.ITopicMapListener

special index implementation supporting paging

Author:
Sven Krosse

Field Summary
private  E parentIndex
          the reference of the parent index
 
Constructor Summary
PagedIndexImpl(T store, E parentIndex)
           
 
Method Summary
 void close()
          
protected  E getParentIndex()
          Returning the reference of the parent index.
 void open()
          
protected
<X> java.util.List<X>
secureSubList(java.util.List<X> list, int offset, int limit)
          Clears the indexes in context to the given list, to avoid indexes out of range.
 
Methods inherited from class de.topicmapslab.majortom.index.IndexImpl
clear, 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.event.ITopicMapListener
topicMapChanged
 

Field Detail

parentIndex

private final E extends org.tmapi.index.Index parentIndex
the reference of the parent index

Constructor Detail

PagedIndexImpl

public PagedIndexImpl(T store,
                      E parentIndex)
Parameters:
store -
parentIndex -
Method Detail

getParentIndex

protected final E getParentIndex()
Returning the reference of the parent index.

Returns:
the parent index

open

public void open()

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

close

public void close()

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

secureSubList

protected final <X> java.util.List<X> secureSubList(java.util.List<X> list,
                                                    int offset,
                                                    int limit)
Clears the indexes in context to the given list, to avoid indexes out of range.

Parameters:
list - the list
offset - the offset
limit - the limit
Returns:
an two-