Package org.apache.uima.cas.impl
Class FSIndexRepositoryImpl.PointerIteratorUnordered
java.lang.Object
org.apache.uima.cas.impl.FSIndexRepositoryImpl.PointerIterator
org.apache.uima.cas.impl.FSIndexRepositoryImpl.PointerIteratorUnordered
- All Implemented Interfaces:
LowLevelIterator
,IntPointerIterator
- Enclosing class:
- FSIndexRepositoryImpl
private class FSIndexRepositoryImpl.PointerIteratorUnordered
extends FSIndexRepositoryImpl.PointerIterator
Version of pointer iterator for unordered uses (bags and getAllIndexedFSs
Since bags have no order, simplify the iteration by just going thru sequentially
all the subtypes
-
Field Summary
Fields inherited from class org.apache.uima.cas.impl.FSIndexRepositoryImpl.PointerIterator
iterators, lastValidIndex, SORTED_SECTION, wentForward
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
PointerIteratorUnordered
(FSIndexRepositoryImpl.IndexIteratorCachePair<? extends FeatureStructure> iicp) private
PointerIteratorUnordered
(FSIndexRepositoryImpl.IndexIteratorCachePair<? extends FeatureStructure> iicp, int fs) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy of this iterator.boolean
isValid()
Check if the iterator is currently valid.int
ll_get()
Return the current FS reference.void
moveTo
(int fs) Try to position the iterator so that the current element is greater than or equal tofsRef
, and previous elements are less thanfsRef
.(package private) void
moveTo
(int fs, boolean isExact) void
Move iterator to first FS in index.void
Move iterator to last FS in index.void
Advance the iterator.void
Move the iterator back one position.Methods inherited from class org.apache.uima.cas.impl.FSIndexRepositoryImpl.PointerIterator
checkConcurrentModification, dec, get, getIicp, inc, ll_getIndex, ll_indexSize, toString
-
Constructor Details
-
PointerIteratorUnordered
private PointerIteratorUnordered(FSIndexRepositoryImpl.IndexIteratorCachePair<? extends FeatureStructure> iicp) -
PointerIteratorUnordered
private PointerIteratorUnordered(FSIndexRepositoryImpl.IndexIteratorCachePair<? extends FeatureStructure> iicp, int fs)
-
-
Method Details
-
isValid
public boolean isValid()Description copied from interface:LowLevelIterator
Check if the iterator is currently valid.- Specified by:
isValid
in interfaceIntPointerIterator
- Specified by:
isValid
in interfaceLowLevelIterator
- Overrides:
isValid
in classFSIndexRepositoryImpl.PointerIterator
- Returns:
true
iff the iterator is valid.
-
ll_get
public int ll_get()Description copied from interface:LowLevelIterator
Return the current FS reference.- Specified by:
ll_get
in interfaceLowLevelIterator
- Overrides:
ll_get
in classFSIndexRepositoryImpl.PointerIterator
- Returns:
- The current FS reference.
-
moveToFirst
public void moveToFirst()Description copied from interface:LowLevelIterator
Move iterator to first FS in index. A subsequent call toisValid()
will succeed iff the index is non-empty.- Specified by:
moveToFirst
in interfaceIntPointerIterator
- Specified by:
moveToFirst
in interfaceLowLevelIterator
- Overrides:
moveToFirst
in classFSIndexRepositoryImpl.PointerIterator
-
moveToLast
public void moveToLast()Description copied from interface:LowLevelIterator
Move iterator to last FS in index. A subsequent call toisValid()
will succeed iff the index is non-empty.- Specified by:
moveToLast
in interfaceIntPointerIterator
- Specified by:
moveToLast
in interfaceLowLevelIterator
- Overrides:
moveToLast
in classFSIndexRepositoryImpl.PointerIterator
-
moveToNext
public void moveToNext()Description copied from interface:LowLevelIterator
Advance the iterator. This may invalidate the iterator.- Specified by:
moveToNext
in interfaceLowLevelIterator
- Overrides:
moveToNext
in classFSIndexRepositoryImpl.PointerIterator
-
moveToPrevious
public void moveToPrevious()Description copied from interface:LowLevelIterator
Move the iterator back one position. This may invalidate the iterator.- Specified by:
moveToPrevious
in interfaceLowLevelIterator
- Overrides:
moveToPrevious
in classFSIndexRepositoryImpl.PointerIterator
-
copy
Description copied from interface:LowLevelIterator
Create a copy of this iterator. The copy will point at the same element that this iterator is currently pointing at.- Specified by:
copy
in interfaceIntPointerIterator
- Specified by:
copy
in interfaceLowLevelIterator
- Overrides:
copy
in classFSIndexRepositoryImpl.PointerIterator
- Returns:
- A copy of this iterator.
-
moveTo
public void moveTo(int fs) Description copied from interface:LowLevelIterator
Try 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:
moveTo
in interfaceIntPointerIterator
- Specified by:
moveTo
in interfaceLowLevelIterator
- Overrides:
moveTo
in classFSIndexRepositoryImpl.PointerIterator
- Parameters:
fs
- The FS reference the iterator should be set to.- See Also:
-
moveTo
void moveTo(int fs, boolean isExact) - Overrides:
moveTo
in classFSIndexRepositoryImpl.PointerIterator
- Parameters:
fs
- the FS to move toisExact
- if true, move to this exact one (must be present), if false, move to the left-most element that is equal to fs using the comparator for the index or if none is equal, move to the next element that is greater than this fs or invalid position of all are less than this fs
-