T
- the Java class type for this indexpublic final class FsIndex_set_sorted<T extends FeatureStructure> extends FsIndex_singletype<T>
casImpl, comparatorForIndexSpecs, comparatorNoTypeWithID, comparatorNoTypeWithoutID, comparatorWithID, comparatorWithoutID, isAnnotIdx, type, wr_cow
FS_ID_COMPARATOR, IS_ORDERED, IS_TYPE_ORDER
BAG_INDEX, DEFAULT_BAG_INDEX, SET_INDEX, SORTED_INDEX
Modifier and Type | Method and Description |
---|---|
protected void |
bulkAddTo(List<T> v)
For serialization: get all the items in this index and bulk add to an
List<T>
|
int |
compare(FeatureStructure o1,
FeatureStructure o2)
This is required to avoid compilation error (but not in Eclipse) due to
ambiguous interface inheritance from both FeatureStructure and Comparator
|
boolean |
contains(FeatureStructure templateKey)
Check if the index contains an element equal to the given feature structure
according to the comparators defined for this index.
|
protected CopyOnWriteIndexPart |
createCopyOnWriteIndexPart() |
boolean |
deleteFS(T fs) |
T |
find(FeatureStructure templateKey)
find any arbitrary matching FS
two comparators: cp, and cpx (has extra id comparing)
First find an FS in the index that's the smallest that's GE to key using cpx
- if none found, then all of the entries in the index are LessThan the key (using cpx);
but one might be equal using cp
-- if one or more would be equal using cp, it would be because
the only reason for the inequality using cpx was due to the _id miscompare.
|
void |
flush() |
LowLevelIterator<T> |
iterator()
Return an iterator over the index.
|
LowLevelIterator<T> |
iterator(boolean orderNotNeeded,
boolean ignoreType)
Internal use, used by select framework.
|
int |
ll_maxAnnotSpan() |
int |
size()
Return the number of feature structures in this index.
|
assertFsTypeMatchesIndexType, compare, equals, getCasImpl, getComparator, getComparatorForIndexSpecs, getComparatorImplForIndexSpecs, getCopyOnWriteIndexPart, getIndexingStrategy, getNonNullCow, getType, getTypeImpl, hashCode, isSorted, iterator, ll_compare, ll_iterator, maybeCopy, toString, withSnapshotIterators
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
getIntIterator, getSubIndex, getSubIndex, ll_iterator, select, select, select, select, select
add, addAll, clear, contains, containsAll, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, toArray, toArray
public void flush()
flush
in interface LowLevelIndex<T extends FeatureStructure>
flush
in class FsIndex_singletype<T extends FeatureStructure>
public boolean contains(FeatureStructure templateKey)
FSIndex
Check if the index contains an element equal to the given feature structure according to the comparators defined for this index. For bag indexes (which have no comparators), the equality test means the identical feature structure. Note that this is in general not the same as feature structure identity.
The element is used as a template, and may be a supertype of the type of the index, as long as the keys specified for this index can be accessed.
templateKey
- the feature structureFSIndex.contains(FeatureStructure)
public T find(FeatureStructure templateKey)
templateKey
- the matching fs templateFSIterator.moveTo(FeatureStructure)
public int size()
FSIndex
size
in interface Collection<T extends FeatureStructure>
size
in interface FSIndex<T extends FeatureStructure>
size
in class AbstractCollection<T extends FeatureStructure>
FSIndex.size()
public boolean deleteFS(T fs)
fs
- - the Feature Structure to be removed. Only this exact Feature
Structure is removed (this is a stronger test than, for example,
what moveTo(fs) does, where the fs in that case is used as a
template). It is not an error if this exact Feature Structure is
not in an index.protected void bulkAddTo(List<T> v)
FsIndex_singletype
bulkAddTo
in class FsIndex_singletype<T extends FeatureStructure>
v
- the set of items to addpublic LowLevelIterator<T> iterator()
LowLevelIndex
iterator
in interface Iterable<T extends FeatureStructure>
iterator
in interface Collection<T extends FeatureStructure>
iterator
in interface FSIndex<T extends FeatureStructure>
iterator
in interface LowLevelIndex<T extends FeatureStructure>
iterator
in class AbstractCollection<T extends FeatureStructure>
public LowLevelIterator<T> iterator(boolean orderNotNeeded, boolean ignoreType)
LowLevelIndex
orderNotNeeded
- if true, skips work while iterating to keep iterators over multiple types in sync.ignoreType
- if true, the comparator used for moveTo leftmost operations
will ignore typeOrder keys, if the index happens to define theseprotected CopyOnWriteIndexPart createCopyOnWriteIndexPart()
createCopyOnWriteIndexPart
in class FsIndex_singletype<T extends FeatureStructure>
public int ll_maxAnnotSpan()
public int compare(FeatureStructure o1, FeatureStructure o2)
FsIndex_singletype
compare
in interface Comparator<FeatureStructure>
compare
in interface FSIndex<T extends FeatureStructure>
compare
in class FsIndex_singletype<T extends FeatureStructure>
o1
- the first Feature Structure to compareo2
- the second Feature Structure to compare-1
if fs1 < fs2
; 0
if
fs1 = fs2
; 1
else.Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.