T
- the Java cover class type for this index, passed along to (wrapped) iterators producing
Java cover classes NOTE: V3 doesn't support ALLOW_DUP_ADD_TO_INDEXESpublic class FsIndex_bag<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> fss)
For serialization: get all the items in this index and bulk add to an List<T>
|
int |
compare(FeatureStructure fs1,
FeatureStructure fs2)
Override the super impl which uses comparators.
|
boolean |
contains(FeatureStructure fs)
Check if the index contains an element equal to the given feature structure according to the
comparators defined for this index.
|
protected CopyOnWriteIndexPart<T> |
createCopyOnWriteIndexPart() |
boolean |
deleteFS(T fs)
only for backwards compatibility
|
T |
find(FeatureStructure fs)
This is a silly method for bag indexes in V3, since dupl add to indexes is not allowed.
|
void |
flush() |
int |
hashCode() |
void |
insert(T fs)
Adding FS to an index.
|
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, 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 final void insert(T fs)
FsIndex_singletype
fs
- the fs to be addedpublic int compare(FeatureStructure fs1, FeatureStructure fs2)
compare
in interface Comparator<FeatureStructure>
compare
in interface FSIndex<T extends FeatureStructure>
compare
in class FsIndex_singletype<T extends FeatureStructure>
fs1
- the first Feature Structure to comparefs2
- the second Feature Structure to compare-1
if fs1 < fs2
; 0
if fs1 = fs2
;
1
else.public boolean contains(FeatureStructure fs)
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.
fs
- A Feature Structure used a template to match for equality with the FSs in the index.true
if the index contains such an element.FSIndex.contains(FeatureStructure)
public T find(FeatureStructure fs)
fs
- -FSIterator.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.public int hashCode()
hashCode
in interface Collection<T extends FeatureStructure>
hashCode
in class FsIndex_singletype<T extends FeatureStructure>
protected void bulkAddTo(List<T> fss)
FsIndex_singletype
bulkAddTo
in class FsIndex_singletype<T extends FeatureStructure>
fss
- the set of items to addpublic 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<T> createCopyOnWriteIndexPart()
createCopyOnWriteIndexPart
in class FsIndex_singletype<T extends FeatureStructure>
public int ll_maxAnnotSpan()
public 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>
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.