Package org.apache.uima.cas.impl
Class FSIndexFlat.FSIteratorFlat<TI extends FeatureStructure>
- java.lang.Object
-
- org.apache.uima.cas.impl.FSIteratorImplBase<TI>
-
- org.apache.uima.cas.impl.FSIndexFlat.FSIteratorFlat<TI>
-
- All Implemented Interfaces:
java.util.Iterator<TI>,FSIterator<TI>,LowLevelIterator
- Enclosing class:
- FSIndexFlat<T extends FeatureStructure>
public static class FSIndexFlat.FSIteratorFlat<TI extends FeatureStructure> extends FSIteratorImplBase<TI> implements LowLevelIterator
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FSIndexFlat.FSIteratorFlat<TI>copy()Create a copy of this iterator.TIget()Get the structure the iterator is pointing at.booleanisUpdateFreeSinceLastCounterReset()booleanisValid()Check if the iterator is currently valid.intll_get()Return the current FS reference.LowLevelIndexll_getIndex()Get the index for just the top most type of this iterator (excludes subtypes).intll_indexSize()Return the size of the underlying index.voidmoveTo(int fsRef)Try to position the iterator so that the current element is greater than or equal tofsRef, and previous elements are less thanfsRef.voidmoveTo(FeatureStructure fs)Move the iterator to the first Feature Structure that is equal tofs.voidmoveToFirst()Move iterator to first FS in index.voidmoveToLast()Move iterator to last FS in index.voidmoveToNext()Advance the iterator.voidmoveToPrevious()Move the iterator back one position.TInext()java.lang.StringtoString()-
Methods inherited from class org.apache.uima.cas.impl.FSIteratorImplBase
hasNext, remove
-
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
next
public TI next()
- Specified by:
nextin interfacejava.util.Iterator<TI extends FeatureStructure>- Overrides:
nextin classFSIteratorImplBase<TI extends FeatureStructure>
-
isValid
public boolean isValid()
Description copied from interface:LowLevelIteratorCheck if the iterator is currently valid.- Specified by:
isValidin interfaceFSIterator<TI extends FeatureStructure>- Specified by:
isValidin interfaceLowLevelIterator- Returns:
trueiff the iterator is valid.
-
get
public TI get() throws java.util.NoSuchElementException
Description copied from interface:FSIteratorGet the structure the iterator is pointing at.- Specified by:
getin interfaceFSIterator<TI extends FeatureStructure>- Returns:
- The structure the iterator is pointing at.
- Throws:
java.util.NoSuchElementException- If the iterator is not valid.
-
moveToNext
public void moveToNext()
Description copied from interface:LowLevelIteratorAdvance the iterator. This may invalidate the iterator.- Specified by:
moveToNextin interfaceFSIterator<TI extends FeatureStructure>- Specified by:
moveToNextin interfaceLowLevelIterator
-
moveToPrevious
public void moveToPrevious()
Description copied from interface:LowLevelIteratorMove the iterator back one position. This may invalidate the iterator.- Specified by:
moveToPreviousin interfaceFSIterator<TI extends FeatureStructure>- Specified by:
moveToPreviousin interfaceLowLevelIterator
-
moveToFirst
public void moveToFirst()
Description copied from interface:LowLevelIteratorMove iterator to first FS in index. A subsequent call toisValid()will succeed iff the index is non-empty.- Specified by:
moveToFirstin interfaceFSIterator<TI extends FeatureStructure>- Specified by:
moveToFirstin interfaceLowLevelIterator
-
moveToLast
public void moveToLast()
Description copied from interface:LowLevelIteratorMove iterator to last FS in index. A subsequent call toisValid()will succeed iff the index is non-empty.- Specified by:
moveToLastin interfaceFSIterator<TI extends FeatureStructure>- Specified by:
moveToLastin interfaceLowLevelIterator
-
moveTo
public void moveTo(FeatureStructure fs)
Description copied from interface:FSIteratorMove the iterator to the first Feature Structure that is equal tofs. First means the earliest one occurring in the index, in case multiple FSs that are "equal" to fs are in the index. If no such feature structure exists in the underlying collection, set the iterator to the "insertion point" forfs, i.e., to a point where the current feature structure is greater thanfs, and the previous one is less thanfs.If the fs is greater than all of the entries in the index, the moveTo cannot set the iterator to an insertion point where the current feature structure is greater than fs, so it marks the iterator "invalid".
If the underlying index is a bag index, no ordering is present, and the moveTo operation moves to the fs which is the same identical fs as the key. If no such fs is in the index, the iterator is marked invalid.
- Specified by:
moveToin interfaceFSIterator<TI extends FeatureStructure>- Parameters:
fs- The feature structure the iterator that supplies the comparison information. It must be of type T or a subtype of T.
-
copy
public FSIndexFlat.FSIteratorFlat<TI> copy()
Description copied from interface:LowLevelIteratorCreate a copy of this iterator. The copy will point at the same element that this iterator is currently pointing at.- Specified by:
copyin interfaceFSIterator<TI extends FeatureStructure>- Specified by:
copyin interfaceLowLevelIterator- Returns:
- A copy of this iterator.
-
isUpdateFreeSinceLastCounterReset
public boolean isUpdateFreeSinceLastCounterReset()
-
ll_get
public int ll_get() throws java.util.NoSuchElementExceptionDescription copied from interface:LowLevelIteratorReturn the current FS reference.- Specified by:
ll_getin interfaceLowLevelIterator- Returns:
- The current FS reference.
- Throws:
java.util.NoSuchElementException- Iff the iterator is not valid.
-
moveTo
public void moveTo(int fsRef)
Description copied from interface:LowLevelIteratorTry to position the iterator so that the current element is greater than or equal tofsRef, and previous elements are less thanfsRef. This may invalidate the iterator. If fsRef can not be compared to FSs in the index, the results are undefined.- Specified by:
moveToin interfaceLowLevelIterator- Parameters:
fsRef- The FS reference the iterator should be set to.
-
ll_indexSize
public int ll_indexSize()
Description copied from interface:LowLevelIteratorReturn the size of the underlying index.- Specified by:
ll_indexSizein interfaceLowLevelIterator- Returns:
- The size of the index.
-
ll_getIndex
public LowLevelIndex ll_getIndex()
Description copied from interface:LowLevelIteratorGet the index for just the top most type of this iterator (excludes subtypes).- Specified by:
ll_getIndexin interfaceLowLevelIterator- Returns:
- The index.
-
-