org.apache.uima.cas.impl
Class FSLeafIndexImpl<T extends FeatureStructure>

java.lang.Object
  extended by org.apache.uima.cas.impl.FSLeafIndexImpl<T>
All Implemented Interfaces:
java.lang.Iterable<T>, FSIndex<T>, FSIndexImpl, LowLevelIndex, IntComparator
Direct Known Subclasses:
FSBagIndex, FSIntArrayIndex, FSVectorIndex

public abstract class FSLeafIndexImpl<T extends FeatureStructure>
extends java.lang.Object
implements IntComparator, FSIndex<T>, FSIndexImpl

Class comment for FSLeafIndexImpl.java goes here.


Field Summary
protected  CASImpl lowLevelCAS
           
 
Fields inherited from interface org.apache.uima.cas.FSIndex
BAG_INDEX, DEFAULT_BAG_INDEX, SET_INDEX, SORTED_INDEX
 
Constructor Summary
protected FSLeafIndexImpl(CASImpl cas, Type type, int indexType)
          Constructor for FSLeafIndexImpl.
 
Method Summary
 int compare(FeatureStructure fs1, FeatureStructure fs2)
          Compare two feature structures according to the ordering relation of the index.
 int compare(int fs1, int fs2)
          Compare two ints.
abstract  void deleteFS(FeatureStructure fs)
          Method deleteFS.
 boolean equals(java.lang.Object o)
           
 FSIndexComparator getComparator()
           
 int getIndexingStrategy()
          Return the indexing strategy.
 IntPointerIterator getIntIterator()
           
 Type getType()
          Return the type of feature structures this index contains.
 int hashCode()
           
 FSIterator<T> iterator()
          Return an iterator over the index.
 FSIterator<T> iterator(FeatureStructure fs)
          Return an iterator over the index.
 int ll_compare(int ref1, int ref2)
           
 LowLevelIterator ll_iterator(boolean ambiguous)
          Get a low-level, FS reference iterator.
 LowLevelIterator ll_rootIterator()
          Get a low-level, FS reference iterator specifying instances of the precise type only (i.e.
abstract  ComparableIntPointerIterator pointerIterator(IntComparator comp, int[] detectIllegalIndexUpdates, int typeCode)
           
protected abstract  IntPointerIterator refIterator()
           
protected abstract  IntPointerIterator refIterator(int fsCode)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.uima.cas.FSIndex
contains, find, size
 
Methods inherited from interface org.apache.uima.cas.impl.FSIndexImpl
flush
 
Methods inherited from interface org.apache.uima.cas.impl.LowLevelIndex
ll_iterator, size
 

Field Detail

lowLevelCAS

protected CASImpl lowLevelCAS
Constructor Detail

FSLeafIndexImpl

protected FSLeafIndexImpl(CASImpl cas,
                          Type type,
                          int indexType)
Constructor for FSLeafIndexImpl.

Method Detail

pointerIterator

public abstract ComparableIntPointerIterator pointerIterator(IntComparator comp,
                                                             int[] detectIllegalIndexUpdates,
                                                             int typeCode)

getComparator

public FSIndexComparator getComparator()
Specified by:
getComparator in interface FSIndexImpl

getIndexingStrategy

public int getIndexingStrategy()
Description copied from interface: FSIndex
Return the indexing strategy.

Specified by:
getIndexingStrategy in interface FSIndex<T extends FeatureStructure>
Returns:
One of SORTED_INDEX, BAG_INDEX or SET_INDEX.

ll_compare

public int ll_compare(int ref1,
                      int ref2)
Specified by:
ll_compare in interface LowLevelIndex

compare

public int compare(int fs1,
                   int fs2)
Description copied from interface: IntComparator
Compare two ints.

Specified by:
compare in interface IntComparator
Parameters:
fs1 - first int.
fs2 - second int.
Returns:
-1 if i < j; 1 if i > j; 0 if i == j.

equals

public final boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compare

public int compare(FeatureStructure fs1,
                   FeatureStructure fs2)
Description copied from interface: FSIndex
Compare two feature structures according to the ordering relation of the index. If the input feature structures are not of the type of the index, the result is undefined.

Specified by:
compare in interface FSIndex<T extends FeatureStructure>
Returns:
-1 if fs1 < fs2; 0 if fs1 = fs2; 1 else.
See Also:
FSIndex.compare(FeatureStructure, FeatureStructure)

getType

public Type getType()
Description copied from interface: FSIndex
Return the type of feature structures this index contains.

Specified by:
getType in interface FSIndex<T extends FeatureStructure>
Returns:
The type of feature structures in this index.
See Also:
FSIndex.getType()

refIterator

protected abstract IntPointerIterator refIterator()

getIntIterator

public IntPointerIterator getIntIterator()
Specified by:
getIntIterator in interface FSIndexImpl

refIterator

protected abstract IntPointerIterator refIterator(int fsCode)

iterator

public FSIterator<T> iterator()
Description copied from interface: FSIndex
Return an iterator over the index. The iterator will be set to the start position of the index.

Specified by:
iterator in interface java.lang.Iterable<T extends FeatureStructure>
Specified by:
iterator in interface FSIndex<T extends FeatureStructure>
Returns:
An iterator over the index.
See Also:
FSIndex.iterator()

iterator

public FSIterator<T> iterator(FeatureStructure fs)
Description copied from interface: FSIndex
Return an iterator over the index. The position of the iterator will be set such that the feature structure returned by a call to the iterator's get() method is greater than or equal to fs, and any previous FS is less than FS. If no such position exists, the iterator will be invalid.

Specified by:
iterator in interface FSIndex<T extends FeatureStructure>
Parameters:
fs - The feature structure at which the iterator should be positioned.
Returns:
An iterator positioned at fs, if it exists. An invalid iterator, else.
See Also:
FSIndex.iterator(FeatureStructure)

deleteFS

public abstract void deleteFS(FeatureStructure fs)
Method deleteFS.

Parameters:
fs -

ll_iterator

public LowLevelIterator ll_iterator(boolean ambiguous)
Description copied from interface: LowLevelIndex
Get a low-level, FS reference iterator. This iterator can be disambiguated. This means that only non-overlapping annotations will be returned. Non-annotation FSs will be filtered in this mode.

Specified by:
ll_iterator in interface LowLevelIndex
Parameters:
ambiguous - When set to false, iterator will be disambiguated.
Returns:
An iterator for this index.

ll_rootIterator

public LowLevelIterator ll_rootIterator()
Description copied from interface: LowLevelIndex
Get a low-level, FS reference iterator specifying instances of the precise type only (i.e. without listing the subtypes).

Specified by:
ll_rootIterator in interface LowLevelIndex
Returns:
An iterator for the root type of this index.


Copyright © 2011. All Rights Reserved.