Package org.apache.uima.cas.impl
Class FSIndexRepositoryImpl.IndexIteratorCachePair<T extends FeatureStructure>
java.lang.Object
org.apache.uima.cas.impl.FSIndexRepositoryImpl.IndexIteratorCachePair<T>
- All Implemented Interfaces:
Comparable<FSIndexRepositoryImpl.IndexIteratorCachePair<? extends FeatureStructure>>
- Enclosing class:
- FSIndexRepositoryImpl
class FSIndexRepositoryImpl.IndexIteratorCachePair<T extends FeatureStructure>
extends Object
implements Comparable<FSIndexRepositoryImpl.IndexIteratorCachePair<? extends FeatureStructure>>
IndexIteratorCachePair (iicp)
A pair of an leaf index and an iterator cache. An iterator cache is the set of all leaf-indexes necessary
to create an iterator for the type of the index.
The cache includes the index for the type of this index, as well as all subtypes.
compareTo() is based on types and the comparator of the index.
T is the Java cover class of the top type (root) in the index set
Also includes a lazily initialized reference to a corresponding FSIndexFlat instance.
This class is package private to share with FSIndexFlat
For Internal Use
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayList<FSLeafIndexImpl<? extends T>>
A list of indexes (the sub-indexes that we need for an iterator).private FSIndexFlat<T>
Link to associated flattened information, set up lazily, only if this level has an iteratorprivate final FSLeafIndexImpl<T>
The "root" index, i.e., index of the type of the iterator.private boolean
(package private) int[]
The type codes corresponding to the cachedSubFsLeafIndexes, set up lazily -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
(package private) void
private void
int
Maybe not used 3/2015 Compares first using the type code of the main types If those are equal, Compares using the comparator objectsprivate void
(package private) Int2IntArrayMapFixedSize
boolean
void
fillFlatArray
(FeatureStructure[] flatArray) Flat array filled, ordered(package private) CASImpl
(package private) FSLeafIndexImpl<T>
(package private) int
A faster version of size() when there are lots of subtypes The cache must be already set up Guess by adding the sizes of up to the first 3 type/subtypes, then add 1 more for each subtype in addition.(package private) boolean
private boolean
int
hashCode()
(package private) boolean
(package private) boolean
isUpdateFreeSinceLastCounterReset
(int typeCode) (package private) int
size()
(package private) boolean
subsumes
(int superType, int subType) toString()
-
Field Details
-
fsLeafIndex
The "root" index, i.e., index of the type of the iterator. default visibility to make it accessable by FSIndexFlat -
cachedSubFsLeafIndexes
A list of indexes (the sub-indexes that we need for an iterator). I.e., one index for each type that's subsumed by the iterator's type; includes the iterator's type leaf index too. -
isIteratorCacheSetup
private volatile boolean isIteratorCacheSetup -
flatIndex
Link to associated flattened information, set up lazily, only if this level has an iterator -
sortedTypeCodes
int[] sortedTypeCodesThe type codes corresponding to the cachedSubFsLeafIndexes, set up lazily
-
-
Constructor Details
-
IndexIteratorCachePair
-
-
Method Details
-
getFsLeafIndex
FSLeafIndexImpl<T> getFsLeafIndex() -
toString
-
equals
-
hashCode
public int hashCode() -
createIndexIteratorCache
private void createIndexIteratorCache() -
compareTo
Maybe not used 3/2015 Compares first using the type code of the main types If those are equal, Compares using the comparator objects- Specified by:
compareTo
in interfaceComparable<T extends FeatureStructure>
- See Also:
-
size
int size()- Returns:
- the sum of the sizes of the indexes of the type + all subtypes
-
has1OrMoreEntries
boolean has1OrMoreEntries() -
guessedSize
int guessedSize()A faster version of size() when there are lots of subtypes The cache must be already set up Guess by adding the sizes of up to the first 3 type/subtypes, then add 1 more for each subtype in addition.- Returns:
- a guess at the size, done quickly
-
fillFlatArray
Flat array filled, ordered- Parameters:
flatArray
- the array to fill
-
createIndexUpdateCountsAtReset
Int2IntArrayMapFixedSize createIndexUpdateCountsAtReset() -
captureIndexUpdateCounts
void captureIndexUpdateCounts() -
captureIndexUpdateCounts
-
isUpdateFreeSinceLastCounterReset
boolean isUpdateFreeSinceLastCounterReset() -
isUpdateFreeSinceLastCounterReset
boolean isUpdateFreeSinceLastCounterReset(int typeCode) -
subsumes
boolean subsumes(int superType, int subType) -
getCASImpl
CASImpl getCASImpl() -
addToIteratedSortedIndexes
void addToIteratedSortedIndexes() -
hasFlatIndex
private boolean hasFlatIndex()
-