public class FsIndex_snapshot<T extends FeatureStructure> extends AbstractCollection<T> implements LowLevelIndex<T>, Comparator<FeatureStructure>
FS_ID_COMPARATOR, IS_ORDERED, IS_TYPE_ORDER
BAG_INDEX, DEFAULT_BAG_INDEX, SET_INDEX, SORTED_INDEX
Constructor and Description |
---|
FsIndex_snapshot(org.apache.uima.cas.impl.FsIndex_iicp<T> wrapped,
Comparator<TOP> comparatorWithoutId,
Comparator<TOP> comparatorTypeWithoutId) |
Modifier and Type | Method and Description |
---|---|
int |
compare(FeatureStructure o1,
FeatureStructure o2)
Compare two feature structures according to the ordering relation of the index.
|
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.
|
T |
find(FeatureStructure fs)
Find an entry in the index "equal to" the given feature structure according to the comparators specified
for this index.
|
CASImpl |
getCasImpl() |
Comparator<TOP> |
getComparator() |
FSIndexComparator |
getComparatorForIndexSpecs()
This is **NOT** a comparator for Feature Structures, but rather
something that compares two comparator specifications
|
int |
getIndexingStrategy()
Return the indexing strategy.
|
Type |
getType()
Return the type of feature structures this index contains.
|
boolean |
isSorted() |
LowLevelIterator<T> |
iterator()
Return an iterator over the index.
|
LowLevelIterator<T> |
iterator(boolean orderNotNeeded,
boolean ignoreType)
Internal use, used by select framework.
|
int |
ll_compare(int ref1,
int ref2)
Compare two Feature structures, referred to by IDs
|
LowLevelIterator<T> |
ll_iterator(boolean ambiguous)
Get a low-level, FS reference iterator.
|
int |
ll_maxAnnotSpan() |
int |
size()
Return the number of feature structures in this index.
|
FSIndex<T> |
withSnapshotIterators()
Creates a shared copy of this FSIndex configured to produce snapshot iterators
that don't throw ConcurrentModificationExceptions.
|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
flush, getIntIterator, getSubIndex, getSubIndex, ll_iterator, select, select, select, select, select
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, toArray, toArray
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public FsIndex_snapshot(org.apache.uima.cas.impl.FsIndex_iicp<T> wrapped, Comparator<TOP> comparatorWithoutId, Comparator<TOP> comparatorTypeWithoutId)
public Type getType()
FSIndex
getType
in interface FSIndex<T extends FeatureStructure>
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.
contains
in interface FSIndex<T extends FeatureStructure>
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.public T find(FeatureStructure fs)
FSIndex
find
in interface FSIndex<T extends FeatureStructure>
fs
- A Feature Structure used a template to match with the Feature Structures in the index.
It must have the keys needed to do the compare as specified for the index that it's in.null
if no such FS exists.FSIterator.moveTo(FeatureStructure)
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>
public LowLevelIterator<T> iterator(boolean orderNotNeeded, boolean ignoreType)
LowLevelIndex
iterator
in interface LowLevelIndex<T extends FeatureStructure>
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 thesepublic int getIndexingStrategy()
FSIndex
getIndexingStrategy
in interface FSIndex<T extends FeatureStructure>
SORTED_INDEX
, BAG_INDEX
or SET_INDEX
.public FSIndex<T> withSnapshotIterators()
FSIndex
withSnapshotIterators
in interface FSIndex<T extends 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>
public int compare(FeatureStructure o1, FeatureStructure o2)
FSIndex
compare
in interface Comparator<FeatureStructure>
compare
in interface FSIndex<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.public LowLevelIterator<T> ll_iterator(boolean ambiguous)
LowLevelIndex
ll_iterator
in interface LowLevelIndex<T extends FeatureStructure>
ambiguous
- When set to false
, iterator will be disambiguated.public int ll_compare(int ref1, int ref2)
LowLevelIndex
ll_compare
in interface LowLevelIndex<T extends FeatureStructure>
ref1
- -ref2
- -public CASImpl getCasImpl()
getCasImpl
in interface LowLevelIndex<T extends FeatureStructure>
public Comparator<TOP> getComparator()
getComparator
in interface LowLevelIndex<T extends FeatureStructure>
public FSIndexComparator getComparatorForIndexSpecs()
LowLevelIndex
getComparatorForIndexSpecs
in interface LowLevelIndex<T extends FeatureStructure>
public int ll_maxAnnotSpan()
ll_maxAnnotSpan
in interface LowLevelIndex<T extends FeatureStructure>
public boolean isSorted()
isSorted
in interface LowLevelIndex<T extends FeatureStructure>
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.