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 Details

    • fsLeafIndex

      private final FSLeafIndexImpl<T extends FeatureStructure> fsLeafIndex
      The "root" index, i.e., index of the type of the iterator. default visibility to make it accessable by FSIndexFlat
    • cachedSubFsLeafIndexes

      private ArrayList<FSLeafIndexImpl<? extends T extends FeatureStructure>> 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

      private FSIndexFlat<T extends FeatureStructure> flatIndex
      Link to associated flattened information, set up lazily, only if this level has an iterator
    • sortedTypeCodes

      int[] sortedTypeCodes
      The type codes corresponding to the cachedSubFsLeafIndexes, set up lazily
  • Constructor Details

    • IndexIteratorCachePair

      private IndexIteratorCachePair(FSLeafIndexImpl<T> fsLeafIndex)
  • Method Details

    • getFsLeafIndex

      FSLeafIndexImpl<T> getFsLeafIndex()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • createIndexIteratorCache

      private void createIndexIteratorCache()
    • compareTo

      public int compareTo(FSIndexRepositoryImpl.IndexIteratorCachePair<? extends FeatureStructure> cp)
      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 interface Comparable<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

      public void fillFlatArray(FeatureStructure[] flatArray)
      Flat array filled, ordered
      Parameters:
      flatArray - the array to fill
    • createIndexUpdateCountsAtReset

      Int2IntArrayMapFixedSize createIndexUpdateCountsAtReset()
    • captureIndexUpdateCounts

      void captureIndexUpdateCounts()
    • captureIndexUpdateCounts

      private void captureIndexUpdateCounts(Int2IntArrayMapFixedSize m)
    • 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()