Class SelectFSs_impl<T extends FeatureStructure>
- All Implemented Interfaces:
AutoCloseable
,Iterable<T>
,BaseStream<T,
,Stream<T>> Stream<T>
,SelectFSs<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T>
-
Constructor Summary
ConstructorDescriptionSelectFSs_impl
(CAS cas) SelectFSs_impl
(FeatureStructure[] source, CAS cas) SelectFSs_impl
(FSArray source) SelectFSs_impl
(FSList source) -
Method Summary
Modifier and TypeMethodDescriptionboolean
allViews()
MiscellaneousallViews
(boolean bAllViews) Extend or not extend the selection to be over all the CAS views, not just a single view.boolean
<N extends T>
SelectFSs_impl<N> anyType()
Select the index's uppermost type.T[]
asList()
at
(int begin, int end) Subselection - specifies selecting Feature Structures having the same begin and end Requires an Annotation Index. - influenced by typePriority, positionUsesType, and useAnnotationEqualsat
(AnnotationFS fs) Subselection - specifies selecting Feature Structures having the same begin and end - influenced by typePriority, positionUsesType, and useAnnotationEquals Requires an Annotation Index.Specifies that the iteration should run in reverse order from normal.backwards
(boolean bBackwards) Specifies that the iteration should run in the normal or reverse order.between
(AnnotationFS fs1, AnnotationFS fs2) Subselection - specifies selecting Feature Structures which lie between two annotations.void
close()
<R> R
collect
(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator, BiConsumer<R, R> combiner) <R,
A> R long
count()
coveredBy
(int begin, int end) Subselection - specifies selecting Feature Structures starting (and maybe ending) within a bounding Feature Structure Requires an Annotation Index.subselection based on boundingFscovering
(int begin, int end) Subselection - specifies selecting Feature Structures starting before or equal to bounding Feature Structure's begin and ending at or beyond the bounding Feature Structure's end Requires an Annotation Index.covering
(AnnotationFS fs) Subselection - specifies selecting Feature Structures starting before or equal to bounding Feature Structure and ending at or beyond the bounding Feature Structure - influenced by typePriority, positionUsesType, useAnnotationEquals Requires an Annotation Index.distinct()
findAny()
<R> Stream
<R> flatMapToDouble
(Function<? super T, ? extends DoubleStream> mapper) flatMapToInt
(Function<? super T, ? extends IntStream> mapper) flatMapToLong
(Function<? super T, ? extends LongStream> mapper) following
(int position) Selectannotations
that follow the specified document position (i.e.following
(int position, int offset) For AnnotationIndex, position to first Annotation whose begin >= position and then adjust position by the offset.following
(Annotation fs) For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd();following
(Annotation fs, int offset) For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd() and then adjust position by the offsetvoid
This method is required, because the 2 interfaces inherited both define this and this is needed to disambiguate Otherwise, get a compile error (but not on Eclipse...)void
forEachOrdered
(Consumer<? super T> action) F S I t e r a t o r -------------------get()
Get the first element or null if empty or the element at the first position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned.get
(int offset) Get the offset element or null if empty or the offset went outside the the selected elements.get
(int begin, int end) Position using a temporary Annotation with its begin and end set to the arguments.get
(int begin, int end, int offset) Position using a temporary Annotation with its begin and end set to the arguments, followed by shifted(offset).get
(FeatureStructure fs) Positions to the fs using moveTo(fs).get
(FeatureStructure fs, int offset) Positions to the fs using moveTo(fs), followed by a shifted(offset).Positions to the fs using moveTo(fs).Positions to the fs using moveTo(fs), followed by a shifted(offset).Meaningful only for coveredBy, includes annotations where the end exceeds the bounding annotation's end.includeAnnotationsWithEndBeyondBounds
(boolean includeAnnotationsWithEndBeyondBounds) Meaningful only for coveredBy, includes or filters out annotations where the end exceeds the bounding annotation's end.INDEX If not specified, defaults to all FSs (orderNotNeeded) unless AnnotationIndex impliedboolean
isEmpty()
boolean
iterator()
limit
(int alimit) Limits the number of Feature Structures returned by this selectlimit
(long maxSize) <R> Stream
<R> mapToDouble
(ToDoubleFunction<? super T> mapper) mapToInt
(ToIntFunction<? super T> mapper) mapToLong
(ToLongFunction<? super T> mapper) max
(Comparator<? super T> comparator) min
(Comparator<? super T> comparator) boolean
Filters while iteratingnonOverlapping
(boolean bNonOverlapping) Meaningful only for Annotation Indexes, specifies that iteration should or should not return only annotations which don't overlap with each other.nullOK()
Applies to the various argument forms of the get and single methods.nullOK
(boolean bNullOk) Applies to the various argument forms of the get and single methods.Specifies that order is not required while iterating over an otherwise ordered index.orderNotNeeded
(boolean bUnordered) Specifies that order is or is not required while iterating over an otherwise ordered index.parallel()
preceding
(int position) Selectannotations
that precede the specified document position (i.e.preceding
(int position, int offset) For AnnotationIndex, set up a selection that will go from the beginning to the first Annotation to the left of the specified position, ending at the last Annotation whose end <= position.preceding
(Annotation fs) For AnnotationIndex, set up a selection that will go from the beginning to the first Annotation to the left of the specified position, whose end <= fs.getBegin().preceding
(Annotation annotation, int offset) For AnnotationIndex, set up a selection that will go from the beginning to the first Annotation to the left of the specified position, ending at the last Annotation whose end <= fs.getBegin(), after adjusting by offset items.reduce
(BinaryOperator<T> accumulator) reduce
(T identity, BinaryOperator<T> accumulator) <U> U
reduce
(U identity, BiFunction<U, ? super T, U> accumulator, BinaryOperator<U> combiner) shifted
(int shiftAmount) starting positionsingle()
single
(int offset) Get the offset element or null if empty or the offset went outside the the selected elements.single
(int begin, int end) Position using a temporary Annotation with its begin and end set to the arguments.single
(int begin, int end, int offset) Position using a temporary Annotation with its begin and end set to the arguments, followed by shifted(offset).Positions to the fs using moveTo(fs).single
(FeatureStructure fs, int offset) Positions to the fs using moveTo(fs), followed by a shifted(offset).Positions to the fs using moveTo(fs).Positions to the fs using moveTo(fs), followed by a shifted(offset).singleOrNull
(int offset) Get the offset element or null if empty or the offset went outside the the selected elements.singleOrNull
(int begin, int end) Position using a temporary Annotation with its begin and end set to the arguments.singleOrNull
(int begin, int end, int offset) Position using a temporary Annotation with its begin and end set to the arguments, followed by shifted(offset).Positions to the fs using moveTo(fs).singleOrNull
(FeatureStructure fs, int offset) Positions to the fs using moveTo(fs), followed by a shifted(offset).singleOrNull
(TOP fs) Positions to the fs using moveTo(fs).singleOrNull
(TOP fs, int offset) Positions to the fs using moveTo(fs), followed by a shifted(offset).skip
(long n) boolean operationssorted()
sorted
(Comparator<? super T> comparator) Iterator respects backwards Sets the characteristics from the context: IMMUTABLE / NONNULL / DISTINCT - always CONCURRENT - never ORDERED - unless orderNotNeeded index or not SORTED_INDEX or SET_INDEX SORTED - only for SORTED_INDEX (and not orderNotNeeded?)startAt
(int begin) Starting Position specification - For Annotation Indexes, specifies which FS to start at.startAt
(int begin, int end) Starting Position specification - For Annotation Indexes, specifies which FS to start at.startAt
(int begin, int end, int offset) Starting Position specification - A combination of startAt followed by a shift Requires an Annotation Index.Starting Position specification - For ordered sources, specifies which FS to start at.startAt
(FeatureStructure fs, int offset) Starting Position specification - A combination of startAt followed by a shift Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted This versions avoids a runtime cast check.Starting Position specification - For ordered sources, specifies which FS to start at.Starting Position specification - A combination of startAt followed by a shift Requires an ordered index not necessarily AnnotationIndex, not necessarily sortedObject[]
toArray()
<A> A[]
toArray
(IntFunction<A[]> generator) <N extends T>
SelectFSs_impl<N> type
(int jcasClass_dot_type) <N extends T>
SelectFSs_impl<N> <N extends T>
SelectFSs_impl<N> <N extends T>
SelectFSs_impl<N> Specify that type priority should be included when comparing two Feature Structures when moving to the leftmost among otherwise equal items for moveTo(fs).typePriority
(boolean aTypePriority) Specify that type priority should or should not be included when comparing two Feature Structures while positioning an iteratoruseAnnotationEquals
(boolean useAnnotationEquals) Meaningful only for coveredBy: if true, then returned annotations are compared to the bounding annotation using the specified kind of equal comparison, and if equal, they are skipped.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.stream.Stream
dropWhile, mapMulti, mapMultiToDouble, mapMultiToInt, mapMultiToLong, takeWhile, toList
-
Constructor Details
-
SelectFSs_impl
-
SelectFSs_impl
-
SelectFSs_impl
-
SelectFSs_impl
-
-
Method Details
-
index
INDEX If not specified, defaults to all FSs (orderNotNeeded) unless AnnotationIndex implied- Parameters:
indexName
- -- Returns:
- -
-
index
-
anyType
Select the index's uppermost type. -
type
-
type
-
type
-
type
-
typePriority
Description copied from interface:SelectFSs
Specify that type priority should be included when comparing two Feature Structures when moving to the leftmost among otherwise equal items for moveTo(fs).Default is to not include type priority.
- Specified by:
typePriority
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
typePriority
Description copied from interface:SelectFSs
Specify that type priority should or should not be included when comparing two Feature Structures while positioning an iteratorDefault is to not include type priority.
- Specified by:
typePriority
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
aTypePriority
- if true says to include the type priority- Returns:
- the updated SelectFSs object
-
skipWhenSameBeginEndType
boolean operations- Specified by:
skipWhenSameBeginEndType
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
useAnnotationEquals
Description copied from interface:SelectFSs
Meaningful only for coveredBy: if true, then returned annotations are compared to the bounding annotation using the specified kind of equal comparison, and if equal, they are skipped.Default is to use feature structure identity comparison (same id()s), not equals, when doing the test to see if an annotation should be skipped.
- Specified by:
useAnnotationEquals
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
useAnnotationEquals
- if true, use equals, if false, use id() ==.- Returns:
- the updated SelectFSs object
-
nonOverlapping
Filters while iterating- Specified by:
nonOverlapping
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
nonOverlapping
Description copied from interface:SelectFSs
Meaningful only for Annotation Indexes, specifies that iteration should or should not return only annotations which don't overlap with each other. Also known as "unambiguous".Default is to not have this filter.
- Specified by:
nonOverlapping
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
bNonOverlapping
- true to specify filtering for only non-overlapping annotations.- Returns:
- the updated SelectFSs object
-
includeAnnotationsWithEndBeyondBounds
Description copied from interface:SelectFSs
Meaningful only for coveredBy, includes annotations where the end exceeds the bounding annotation's end.Default is to NOT include annotations whose end exceeds the bounding annotation's end.
- Specified by:
includeAnnotationsWithEndBeyondBounds
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
includeAnnotationsWithEndBeyondBounds
public SelectFSs_impl<T> includeAnnotationsWithEndBeyondBounds(boolean includeAnnotationsWithEndBeyondBounds) Description copied from interface:SelectFSs
Meaningful only for coveredBy, includes or filters out annotations where the end exceeds the bounding annotation's end.Default is to NOT include annotations whose end exceeds the bounding annotation's end.
- Specified by:
includeAnnotationsWithEndBeyondBounds
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
includeAnnotationsWithEndBeyondBounds
- false to filter out annotations whose end exceeds the bounding annotation's end- Returns:
- the updated SelectFSs object
-
allViews
Miscellaneous- Specified by:
allViews
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
allViews
Description copied from interface:SelectFSs
Extend or not extend the selection to be over all the CAS views, not just a single view.Default is that the selection is just for one CAS view
- Specified by:
allViews
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
bAllViews
- true to extend the selection.- Returns:
- the updated SelectFSs object
-
nullOK
Description copied from interface:SelectFSs
Applies to the various argument forms of the get and single methods. Indicates that a null value should not throw an exception.Calling this method is equivalent to nullOK(true). If never called, nulls are not OK by default.
- Specified by:
nullOK
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
nullOK
Description copied from interface:SelectFSs
Applies to the various argument forms of the get and single methods. Indicates that a null value should or should not throw an exception.Default: null is not OK as a value
- Specified by:
nullOK
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
bNullOk
- true if null is an ok value.- Returns:
- the updated SelectFSs object
-
orderNotNeeded
Description copied from interface:SelectFSs
Specifies that order is not required while iterating over an otherwise ordered index. This can be a performance boost for hierarchically nested types.Default: order is required by default, when iterating over an ordered index.
- Specified by:
orderNotNeeded
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
orderNotNeeded
Description copied from interface:SelectFSs
Specifies that order is or is not required while iterating over an otherwise ordered index. This can be a performance boost for hierarchically nested types.Default: order is required by default, when iterating over an ordered index.
- Specified by:
orderNotNeeded
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
bUnordered
- true means order is not needed.- Returns:
- the updated SelectFSs object
-
backwards
Description copied from interface:SelectFSs
Specifies that the iteration should run in reverse order from normal. Note that this does not compose; two calls to this will still result in the iteration running in reverse order.- Specified by:
backwards
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the updated SelectFSs object
-
backwards
Description copied from interface:SelectFSs
Specifies that the iteration should run in the normal or reverse order. Note that this does not compose.- Specified by:
backwards
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
bBackwards
- true to run in reverse order- Returns:
- the updated SelectFSs object
-
shifted
starting position- Specified by:
shifted
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
shiftAmount
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
startAt
Description copied from interface:SelectFSs
Starting Position specification - For ordered sources, specifies which FS to start at. Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted- Specified by:
startAt
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- a Feature Structure specifying a starting position.- Returns:
- the updated SelectFSs object
-
startAt
Description copied from interface:SelectFSs
Starting Position specification - For ordered sources, specifies which FS to start at. Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted- Specified by:
startAt
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- a Feature Structure specifying a starting position.- Returns:
- the updated SelectFSs object
-
startAt
Description copied from interface:SelectFSs
Starting Position specification - For Annotation Indexes, specifies which FS to start at. This method is incompatible withSelectFSs.typePriority()
and turns type priorities off implicitly. Do not turn type priorities back on. Positions to the leftmost (if there are multiple equal ones) Annotation whose begin is >= begin- Specified by:
startAt
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin bound- Returns:
- the updated SelectFSs object
-
startAt
Description copied from interface:SelectFSs
Starting Position specification - For Annotation Indexes, specifies which FS to start at.- Specified by:
startAt
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
startAt
Description copied from interface:SelectFSs
Starting Position specification - A combination of startAt followed by a shift Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted- Specified by:
startAt
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- a Feature Structure specifying a starting position.offset
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
startAt
Description copied from interface:SelectFSs
Starting Position specification - A combination of startAt followed by a shift Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted This versions avoids a runtime cast check.- Specified by:
startAt
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- a Feature Structure specifying a starting position.offset
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
startAt
Description copied from interface:SelectFSs
Starting Position specification - A combination of startAt followed by a shift Requires an Annotation Index.- Specified by:
startAt
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin boundend
- the end boundoffset
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
limit
Description copied from interface:SelectFSs
Limits the number of Feature Structures returned by this select- Specified by:
limit
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
alimit
- the maximum number of feature structures returned. This must be a value >= 0.- Returns:
- the updated SelectFSs object
-
coveredBy
subselection based on boundingFs- Specified by:
coveredBy
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- specifies the bounds.- Returns:
- the updated SelectFSs object
-
coveredBy
Description copied from interface:SelectFSs
Subselection - specifies selecting Feature Structures starting (and maybe ending) within a bounding Feature Structure Requires an Annotation Index.- Specified by:
coveredBy
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
covering
Description copied from interface:SelectFSs
Subselection - specifies selecting Feature Structures starting before or equal to bounding Feature Structure and ending at or beyond the bounding Feature Structure - influenced by typePriority, positionUsesType, useAnnotationEquals Requires an Annotation Index.- Specified by:
covering
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- specifies the bounds.- Returns:
- the updated SelectFSs object
-
covering
Description copied from interface:SelectFSs
Subselection - specifies selecting Feature Structures starting before or equal to bounding Feature Structure's begin and ending at or beyond the bounding Feature Structure's end Requires an Annotation Index.- Specified by:
covering
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
between
Description copied from interface:SelectFSs
Subselection - specifies selecting Feature Structures which lie between two annotations. A bounding Annotation is constructed whose begin is the end of fs1, and whose end is the begin of fs2. Requires an Annotation Index.If fs1 > fs2, they are swapped.
- Specified by:
between
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs1
- the beginning boundfs2
- the ending bound- Returns:
- the updated SelectFSs object
-
at
Description copied from interface:SelectFSs
Subselection - specifies selecting Feature Structures having the same begin and end - influenced by typePriority, positionUsesType, and useAnnotationEquals Requires an Annotation Index.- Specified by:
at
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- specifies the bounds.- Returns:
- the updated SelectFSs object
-
at
Description copied from interface:SelectFSs
Subselection - specifies selecting Feature Structures having the same begin and end Requires an Annotation Index. - influenced by typePriority, positionUsesType, and useAnnotationEquals- Specified by:
at
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
fsIterator
F S I t e r a t o r -------------------- Specified by:
fsIterator
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- an FSIterator over the selection. The iterator is set up depending on preceding configuration calls to this SelectFSs instance.
-
iterator
- Specified by:
iterator
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>> - Specified by:
iterator
in interfaceIterable<T extends FeatureStructure>
-
asList
- Specified by:
asList
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- a List object whose elements represent the selection.
-
asArray
- Specified by:
asArray
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
clazz
- the class of the type of the elements- Returns:
- a Array object representation of the elements of the selection.
-
spliterator
Iterator respects backwards Sets the characteristics from the context: IMMUTABLE / NONNULL / DISTINCT - always CONCURRENT - never ORDERED - unless orderNotNeeded index or not SORTED_INDEX or SET_INDEX SORTED - only for SORTED_INDEX (and not orderNotNeeded?) SIZED - if exact size is (easily) known, just from index. false if bounded, unambiguous SUBSIZED - if spliterator result from trysplit also is SIZED, set to true for now trySplit impl: always returns null (no parallelism support for now)- Specified by:
spliterator
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>> - Specified by:
spliterator
in interfaceIterable<T extends FeatureStructure>
- Specified by:
spliterator
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- the spliterator
-
get
Description copied from interface:SelectFSs
Get the first element or null if empty or the element at the first position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned.- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- first element or null if empty
-
single
- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- first element, verifying that the size of the selection is 1 (or maybe 0)
-
singleOrNull
- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- first element, which may be null, or null if selection is empty.
-
get
Description copied from interface:SelectFSs
Get the offset element or null if empty or the offset went outside the the selected elements.If nullOK is false, then throws CASRuntimeException if null would have been returned, or the selection is empty, or doesn't have enough elements to satisfy the positioning.
- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
offset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null
-
single
Description copied from interface:SelectFSs
Get the offset element or null if empty or the offset went outside the the selected elements.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive, reverse direction if offset is negative) then throw an exception.
If nullOK is false, then throws CASRuntimeException if null would have been returned, or the selection is empty, or doesn't have enough elements to satisfy the positioning.
- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
offset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null
-
singleOrNull
Description copied from interface:SelectFSs
Get the offset element or null if empty or the offset went outside the the selected elements.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive, reverse direction if offset is negative) then throw an exception.
- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
offset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null
-
get
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs). Get the element at that position or null if empty or the element at that position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned. This versions avoids a runtime cast check.- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
-
get
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs). Get the element at that position or null if empty or the element at that position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned.- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
-
single
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs). Get the element at that position or null if empty or the element at that position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned. This versions avoids a runtime cast check.- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
-
single
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs). Get the element at that position or null if empty or the element at that position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned.- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
-
singleOrNull
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs). Get the element at that position or null if empty or the element at that position is null. This versions avoids a runtime cast check.- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
-
singleOrNull
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs). Get the element at that position or null if empty or the element at that position is null.- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
-
get
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs), followed by a shifted(offset). Gets the element at that position or null if empty or the element at that position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned. This versions avoids a runtime cast check.- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- where to move tooffset
- the offset move after positioning to fs, may be 0 or positive or negative- Returns:
- the selected element or null if empty
-
get
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs), followed by a shifted(offset). Gets the element at that position or null if empty or the element at that position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned.- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- where to move tooffset
- the offset move after positioning to fs, may be 0 or positive or negative- Returns:
- the selected element or null if empty
-
single
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs), followed by a shifted(offset). Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive or 0, reverse direction if offset is negative) then throw an exception.
If nullOK is false, then throws CASRuntimeException if null would have been returned. This versions avoids a runtime cast check.
- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
-
single
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs), followed by a shifted(offset). Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive or 0, reverse direction if offset is negative) then throw an exception.
If nullOK is false, then throws CASRuntimeException if null would have been returned.
- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
-
singleOrNull
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs), followed by a shifted(offset). Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive or 0, reverse direction if offset is negative) then throw an exception.
This versions avoids a runtime cast check.
- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
-
singleOrNull
Description copied from interface:SelectFSs
Positions to the fs using moveTo(fs), followed by a shifted(offset). Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive or 0, reverse direction if offset is negative) then throw an exception.
- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
-
get
Description copied from interface:SelectFSs
Position using a temporary Annotation with its begin and end set to the arguments. Gets the element at that position or null if empty or the element at that position is null. if nullOK is false, then throws CASRuntimeException if null would have been returned. This versions avoids a runtime cast check.- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotation- Returns:
- the selected element or null if empty
-
single
Description copied from interface:SelectFSs
Position using a temporary Annotation with its begin and end set to the arguments. Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element following the one being returned then throw an exception.
if nullOK is false, then throws CASRuntimeException if null would have been returned.
- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotation- Returns:
- the selected element or null if empty
-
singleOrNull
Description copied from interface:SelectFSs
Position using a temporary Annotation with its begin and end set to the arguments. Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element following the one being returned then throw an exception.
- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotation- Returns:
- the selected element or null if empty
-
get
Description copied from interface:SelectFSs
Position using a temporary Annotation with its begin and end set to the arguments, followed by shifted(offset). Gets the element at that position or null if empty or the element at that position is null.- Specified by:
get
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotationoffset
- the amount (positive or negative or 0) passed as an argument to shifted(int)- Returns:
- the selected element or null if empty
-
single
Description copied from interface:SelectFSs
Position using a temporary Annotation with its begin and end set to the arguments, followed by shifted(offset). Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive or 0, reverse direction if offset is negative) then throw an exception.
- Specified by:
single
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotationoffset
- the amount (positive or negative or 0) passed as an argument to shifted(int)- Returns:
- the selected element or null if empty
-
singleOrNull
Description copied from interface:SelectFSs
Position using a temporary Annotation with its begin and end set to the arguments, followed by shifted(offset). Gets the element at that position or null if empty or the element at that position is null.If, after positioning, there is another element next to the one being returned (in the forward direction if offset is positive or 0, reverse direction if offset is negative) then throw an exception.
- Specified by:
singleOrNull
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotationoffset
- the amount (positive or negative or 0) passed as an argument to shifted(int)- Returns:
- the selected element or null if empty
-
following
Description copied from interface:SelectFSs
For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd();- Specified by:
following
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the Annotation to follow- Returns:
- the updated SelectFSs object
-
following
Description copied from interface:SelectFSs
Selectannotations
that follow the specified document position (i.e. character offset). This is equivalent to performing afollowing(new Annotation(jcas, 0, position)
, so all annotations starting atposition
or after are returned, including zero-width annotations.- Specified by:
following
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
position
- start following this position- Returns:
- the updated SelectFSs object
-
following
Description copied from interface:SelectFSs
For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd() and then adjust position by the offset- Specified by:
following
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- start following this Annotation, adjusted for the offsetoffset
- positive or negative shift amount to adjust starting position- Returns:
- the updated SelectFSs object
-
following
Description copied from interface:SelectFSs
For AnnotationIndex, position to first Annotation whose begin >= position and then adjust position by the offset.- Specified by:
following
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
position
- start following this position, adjusted for the offsetoffset
- positive or negative shift amount to adjust starting position- Returns:
- the updated SelectFSs object
-
preceding
Description copied from interface:SelectFSs
For AnnotationIndex, set up a selection that will go from the beginning to the first Annotation to the left of the specified position, whose end <= fs.getBegin(). Annotations whose end > fs.getBegin() are skipped.- Specified by:
preceding
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
fs
- the Annotation to use as the position to start before.- Returns:
- the updated SelectFSs object
-
preceding
Description copied from interface:SelectFSs
Selectannotations
that precede the specified document position (i.e. character offset). This is equivalent to performing apreceding(new Annotation(jcas, position, Integer.MAX_VALUE)
, so all annotations ending atposition
or before are returned, including zero-width annotations.- Specified by:
preceding
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
position
- start following this position- Returns:
- the updated SelectFSs object
-
preceding
Description copied from interface:SelectFSs
For AnnotationIndex, set up a selection that will go from the beginning to the first Annotation to the left of the specified position, ending at the last Annotation whose end <= fs.getBegin(), after adjusting by offset items. Annotations whose end > fs.getBegin() are skipped (including during the offset positioning)- Specified by:
preceding
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
annotation
- the Annotation to use as the position to start before.offset
- the offset adjustment, positive or negative. Positive moves backwards.- Returns:
- the updated SelectFSs object
-
preceding
Description copied from interface:SelectFSs
For AnnotationIndex, set up a selection that will go from the beginning to the first Annotation to the left of the specified position, ending at the last Annotation whose end <= position. after adjusting by offset items. Annotations whose end > position are skipped (including during the offset positioning)- Specified by:
preceding
in interfaceSelectFSs<T extends FeatureStructure>
- Parameters:
position
- the position to start before.offset
- the offset adjustment, positive or negative. Positive moves backwards.- Returns:
- the updated SelectFSs object
-
filter
- Specified by:
filter
in interfaceStream<T extends FeatureStructure>
-
map
- Specified by:
map
in interfaceStream<T extends FeatureStructure>
-
mapToInt
- Specified by:
mapToInt
in interfaceStream<T extends FeatureStructure>
-
mapToLong
- Specified by:
mapToLong
in interfaceStream<T extends FeatureStructure>
-
mapToDouble
- Specified by:
mapToDouble
in interfaceStream<T extends FeatureStructure>
-
flatMap
- Specified by:
flatMap
in interfaceStream<T extends FeatureStructure>
-
flatMapToInt
- Specified by:
flatMapToInt
in interfaceStream<T extends FeatureStructure>
-
flatMapToLong
- Specified by:
flatMapToLong
in interfaceStream<T extends FeatureStructure>
-
flatMapToDouble
- Specified by:
flatMapToDouble
in interfaceStream<T extends FeatureStructure>
-
distinct
- Specified by:
distinct
in interfaceStream<T extends FeatureStructure>
-
sorted
- Specified by:
sorted
in interfaceStream<T extends FeatureStructure>
-
sorted
- Specified by:
sorted
in interfaceStream<T extends FeatureStructure>
-
peek
- Specified by:
peek
in interfaceStream<T extends FeatureStructure>
-
limit
- Specified by:
limit
in interfaceStream<T extends FeatureStructure>
-
skip
- Specified by:
skip
in interfaceStream<T extends FeatureStructure>
-
forEach
Description copied from interface:SelectFSs
This method is required, because the 2 interfaces inherited both define this and this is needed to disambiguate Otherwise, get a compile error (but not on Eclipse...)- Specified by:
forEach
in interfaceIterable<T extends FeatureStructure>
- Specified by:
forEach
in interfaceSelectFSs<T extends FeatureStructure>
- Specified by:
forEach
in interfaceStream<T extends FeatureStructure>
-
forEachOrdered
- Specified by:
forEachOrdered
in interfaceStream<T extends FeatureStructure>
-
toArray
- Specified by:
toArray
in interfaceStream<T extends FeatureStructure>
-
toArray
- Specified by:
toArray
in interfaceStream<T extends FeatureStructure>
-
reduce
- Specified by:
reduce
in interfaceStream<T extends FeatureStructure>
-
reduce
- Specified by:
reduce
in interfaceStream<T extends FeatureStructure>
-
reduce
- Specified by:
reduce
in interfaceStream<T extends FeatureStructure>
-
collect
public <R> R collect(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator, BiConsumer<R, R> combiner) - Specified by:
collect
in interfaceStream<T extends FeatureStructure>
-
collect
- Specified by:
collect
in interfaceStream<T extends FeatureStructure>
-
min
- Specified by:
min
in interfaceStream<T extends FeatureStructure>
-
max
- Specified by:
max
in interfaceStream<T extends FeatureStructure>
-
count
public long count()- Specified by:
count
in interfaceStream<T extends FeatureStructure>
-
anyMatch
- Specified by:
anyMatch
in interfaceStream<T extends FeatureStructure>
-
allMatch
- Specified by:
allMatch
in interfaceStream<T extends FeatureStructure>
-
noneMatch
- Specified by:
noneMatch
in interfaceStream<T extends FeatureStructure>
-
findFirst
- Specified by:
findFirst
in interfaceStream<T extends FeatureStructure>
-
findAny
- Specified by:
findAny
in interfaceStream<T extends FeatureStructure>
-
isParallel
public boolean isParallel()- Specified by:
isParallel
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>>
-
sequential
- Specified by:
sequential
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>>
-
parallel
- Specified by:
parallel
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>>
-
onClose
- Specified by:
onClose
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>>
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>>
-
unordered
- Specified by:
unordered
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceSelectFSs<T extends FeatureStructure>
- Returns:
- true if the selection is empty
-