public interface LowLevelIterator<T extends FeatureStructure> extends FSIterator<T>
FSIterator
Modifier and Type | Field and Description |
---|---|
static LowLevelIterator<FeatureStructure> |
FS_ITERATOR_LOW_LEVEL_EMPTY
an empty iterator
|
static boolean |
IS_ORDERED
Internal use constants
|
Modifier and Type | Method and Description |
---|---|
default void |
getArrayList(ArrayList<? super T> arrayList) |
Comparator<TOP> |
getComparator() |
boolean |
isIndexesHaveBeenUpdated() |
default boolean |
isMoveToSupported() |
default int |
ll_get()
Return the current FS reference.
|
LowLevelIndex<T> |
ll_getIndex()
Get the index for just the top most type of this iterator (excludes subtypes).
|
int |
ll_indexSizeMaybeNotCurrent() |
int |
ll_maxAnnotSpan() |
default void |
ll_remove() |
boolean |
maybeReinitIterator()
Internal use
|
default void |
moveTo(FeatureStructure fs)
Move the iterator to the first Feature Structure that matches the
fs . |
default void |
moveTo(int fsRef)
Try to position the iterator so that the current element is greater than or equal to
fsRef , and previous elements are less than fsRef . |
default void |
moveToFirst()
Move the iterator to the first element.
|
void |
moveToFirstNoReinit()
Internal use same as moveToFirst, but won't reset to use current contents of index if index has
changed
|
default void |
moveToLast()
Move the iterator to the last element.
|
void |
moveToLastNoReinit()
Internal use same as moveToLast, but won't reset to use current contents of index if index has
changed
|
void |
moveToNoReinit(FeatureStructure fs)
Internal use same as moveTo(fs), but won't reset to use current contents of index if index has
changed
|
add, copy, get, getNvc, getType, hasNext, hasPrevious, isValid, moveToNext, moveToNextNvc, moveToPrevious, moveToPreviousNvc, next, nextIndex, nextNvc, previous, previousIndex, previousNvc, remove, set, size, spliterator, stream
forEachRemaining
static final LowLevelIterator<FeatureStructure> FS_ITERATOR_LOW_LEVEL_EMPTY
static final boolean IS_ORDERED
default int ll_get() throws NoSuchElementException
NoSuchElementException
- Iff the iterator is not valid.default void moveTo(int fsRef)
fsRef
, and previous elements are less than fsRef
. This may invalidate
the iterator. If fsRef can not be compared to FSs in the index, the results are undefined.fsRef
- The FS reference the iterator should be set to.int ll_indexSizeMaybeNotCurrent()
LowLevelIndex<T> ll_getIndex()
int ll_maxAnnotSpan()
boolean isIndexesHaveBeenUpdated()
boolean maybeReinitIterator()
default void moveToFirst()
FSIterator
moveToFirst
in interface FSIterator<T extends FeatureStructure>
default void moveToLast()
FSIterator
moveToLast
in interface FSIterator<T extends FeatureStructure>
default void moveTo(FeatureStructure fs)
FSIterator
fs
. First means
the earliest one occurring in the index, in case multiple FSs matching the fs are in the index.
If no such feature structure exists in the underlying collection, and the iterator is over a
sorted index, set the iterator to the "insertion point" for fs
, i.e., to a point
where the current feature structure compares greater than fs
, and the previous one
compares less than fs
, using this sorted index's comparator.
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 set or bag index, or an unordered form of iteration is configured
(for example using the select
API, no ordering is present, and the moveTo
operation moves to a matching item, if one exists. The match is done using the index's
comparator. If none exist, the index is left if possible in some valid (but non-matching)
position.
When the iterator is over a sorted index whose keys include the typeOrder key, this can cause unexpected operation, depending on type priorities. For example, consider the Annotation Index, which includes this key. If there are many indexed instances of the type "Foo" with the same begin and end, and a moveTo operation is specified using an Annotation instance with the same begin and end, then the Foo elements might or might not be seen going forwards, depending on the relative type priorities of "Foo" and "Annotation".
If you are not making use of typeOrdering, the "select" APIs can create iterators which will ignore the typeOrdering key when doing the moveTo operation, which will result in all the instances of type "Foo" being seen going forwards, independent of the type priorities. See the select documentation in the version 3 users guide.
moveTo
in interface FSIterator<T extends FeatureStructure>
fs
- The feature structure the iterator that supplies the comparison information. It
doesn't need to be in the index; it is just being used as a comparison template. It
can be a supertype of T as long as it can supply the keys needed. A typical example is
a subtype of Annotation, and using an annotation instance to specify the begin / end.void moveToFirstNoReinit()
void moveToLastNoReinit()
void moveToNoReinit(FeatureStructure fs)
fs
- the fs to use as the template identifying the place to move toComparator<TOP> getComparator()
default void ll_remove()
default boolean isMoveToSupported()
default void getArrayList(ArrayList<? super T> arrayList)
arrayList
- updated by adding elements representing the collection of items the iterator would
return from its current position to the end
NOTE: This operation will move the iterator from its current position to the end.Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.