Package org.apache.uima.cas.impl
Class FSIndexRepositoryImpl.SnapshotPointerIterator<T extends FeatureStructure>
java.lang.Object
org.apache.uima.cas.impl.FSIndexRepositoryImpl.SnapshotPointerIterator<T>
- All Implemented Interfaces:
LowLevelIterator
,IntPointerIterator
- Enclosing class:
FSIndexRepositoryImpl
private class FSIndexRepositoryImpl.SnapshotPointerIterator<T extends FeatureStructure>
extends Object
implements IntPointerIterator, LowLevelIterator
This implementation creates a pseudo index that is
flattened and
copied (so it is a snapshot), and
returns an iterator over that
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private final int
private final int[]
private final FSIntArrayIndex
<T> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
private
SnapshotPointerIterator
(FSIndexRepositoryImpl.IndexIteratorCachePair<T> iicp0, boolean isRootOnly) private
SnapshotPointerIterator
(FSIndexRepositoryImpl.IndexIteratorCachePair<T> iicp0, int fs) -
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy of this iterator.void
dec()
private void
flattenCopy
(FSIndexRepositoryImpl.IndexIteratorCachePair<T> iicp0, boolean isRootOnly) int
get()
void
inc()
boolean
isValid()
Check if the iterator is currently valid.int
ll_get()
Return the current FS reference.Get the index for just the top most type of this iterator (excludes subtypes).int
Return the size of the underlying index.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.toString()
-
Field Details
-
sortedLeafIndex
-
snapshot
private final int[] snapshot -
size
private final int size -
pos
private int pos
-
-
Constructor Details
-
SnapshotPointerIterator
-
SnapshotPointerIterator
private SnapshotPointerIterator(FSIndexRepositoryImpl.IndexIteratorCachePair<T> iicp0, boolean isRootOnly) -
SnapshotPointerIterator
-
-
Method Details
-
toString
-
flattenCopy
-
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
- Returns:
true
iff the iterator is valid.
-
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
-
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
-
moveToNext
public void moveToNext()Description copied from interface:LowLevelIterator
Advance the iterator. This may invalidate the iterator.- Specified by:
moveToNext
in interfaceLowLevelIterator
-
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
-
get
- Specified by:
get
in interfaceIntPointerIterator
- Throws:
NoSuchElementException
-
ll_get
public int ll_get()Description copied from interface:LowLevelIterator
Return the current FS reference.- Specified by:
ll_get
in interfaceLowLevelIterator
- Returns:
- The current FS reference.
-
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
- Parameters:
fs
- The FS reference the iterator should be set to.- See Also:
-
moveTo
void moveTo(int fs, boolean isExact) -
inc
public void inc()- Specified by:
inc
in interfaceIntPointerIterator
-
dec
public void dec()- Specified by:
dec
in interfaceIntPointerIterator
-
ll_indexSize
public int ll_indexSize()Description copied from interface:LowLevelIterator
Return the size of the underlying index.- Specified by:
ll_indexSize
in interfaceLowLevelIterator
- Returns:
- The size of the index.
-
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
- Returns:
- A copy of this iterator.
-
ll_getIndex
Description copied from interface:LowLevelIterator
Get the index for just the top most type of this iterator (excludes subtypes).- Specified by:
ll_getIndex
in interfaceLowLevelIterator
- Returns:
- The index.
-