Interface SelectFSs<T extends FeatureStructure>
- All Superinterfaces:
AutoCloseable
,BaseStream<T,
,Stream<T>> Iterable<T>
,Stream<T>
- All Known Implementing Classes:
SelectFSs_impl
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.stream.Stream
Stream.Builder<T>
-
Method Summary
Modifier and TypeMethodDescriptionallViews()
Extend the selection to be over all the CAS views, not just a single view.allViews
(boolean allViews) Extend or not extend the selection to be over all the CAS views, not just a single view.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 backwards) 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.coveredBy
(int begin, int end) Subselection - specifies selecting Feature Structures starting (and maybe ending) within a bounding Feature Structure Requires an Annotation Index.Subselection - specifies selecting Feature Structures starting (and maybe ending) within a bounding Feature Structure - influenced by typePriority, positionUsesType, useAnnotationEquals, includeAnnotationsWithEndBeyondBounds Requires an Annotation Index.covering
(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.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 annotation) For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd();following
(Annotation annotation, int offset) For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd() and then adjust position by the offsetdefault void
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...)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.boolean
isEmpty()
limit
(int n) Limits the number of Feature Structures returned by this selectMeaningful only for Annotation Indexes, specifies that iteration should return only annotations which don't overlap with each other.nonOverlapping
(boolean nonOverlapping) 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 nullOk) 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 unordered) Specifies that order is or is not required while iterating over an otherwise ordered index.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 annotation) 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.static <U extends FeatureStructure>
SelectFSs<U> Use this static method to capture the generic argumentshifted
(int shiftAmount) Starting Position specification - Shifts the normal start position by the shiftAmount, which may be negative.single()
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).Meaningful only for coveredBy and covering: if true, then returned annotations are compared equal to the bounding annotation, and if equal, they are skipped.default Spliterator
<T> 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 shift) 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 shift) 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 sortedSpecify 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 typePriority) 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 interface java.util.stream.BaseStream
close, isParallel, iterator, onClose, parallel, sequential, unordered
Methods inherited from interface java.util.stream.Stream
allMatch, anyMatch, collect, collect, count, distinct, dropWhile, filter, findAny, findFirst, flatMap, flatMapToDouble, flatMapToInt, flatMapToLong, forEachOrdered, limit, map, mapMulti, mapMultiToDouble, mapMultiToInt, mapMultiToLong, mapToDouble, mapToInt, mapToLong, max, min, noneMatch, peek, reduce, reduce, reduce, skip, sorted, sorted, takeWhile, toArray, toArray, toList
-
Method Details
-
typePriority
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.
- Returns:
- the updated SelectFSs object
-
typePriority
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.
- Parameters:
typePriority
- if true says to include the type priority- Returns:
- the updated SelectFSs object
-
nonOverlapping
Meaningful only for Annotation Indexes, specifies that iteration should return only annotations which don't overlap with each other. Also known as "unambiguous".Default is to not have this filter.
- Returns:
- the updated SelectFSs object
-
nonOverlapping
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.
- Parameters:
nonOverlapping
- true to specify filtering for only non-overlapping annotations.- Returns:
- the updated SelectFSs object
-
includeAnnotationsWithEndBeyondBounds
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.
- Returns:
- the updated SelectFSs object
-
includeAnnotationsWithEndBeyondBounds
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.
- Parameters:
includeAnnotationsWithEndBeyondBounds
- false to filter out annotations whose end exceeds the bounding annotation's end- Returns:
- the updated SelectFSs object
-
skipWhenSameBeginEndType
Meaningful only for coveredBy and covering: if true, then returned annotations are compared equal to the bounding annotation, 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.
This is identical to useAnnotationEquals(true).
- Returns:
- the updated SelectFSs object
-
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.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.
- Parameters:
useAnnotationEquals
- if true, use equals, if false, use id() ==.- Returns:
- the updated SelectFSs object
-
allViews
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
- Returns:
- the updated SelectFSs object
-
allViews
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
- Parameters:
allViews
- true to extend the selection.- Returns:
- the updated SelectFSs object
-
nullOK
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.
- Returns:
- the updated SelectFSs object
-
nullOK
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
- Parameters:
nullOk
- true if null is an ok value.- Returns:
- the updated SelectFSs object
-
orderNotNeeded
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.
- Returns:
- the updated SelectFSs object
-
orderNotNeeded
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.
- Parameters:
unordered
- true means order is not needed.- Returns:
- the updated SelectFSs object
-
backwards
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.- Returns:
- the updated SelectFSs object
-
backwards
Specifies that the iteration should run in the normal or reverse order. Note that this does not compose.- Parameters:
backwards
- true to run in reverse order- Returns:
- the updated SelectFSs object
-
shifted
Starting Position specification - Shifts the normal start position by the shiftAmount, which may be negative. Repeated calls to this just replaces the requested shift amount; a single shift only occurs when a result is obtained.- Parameters:
shiftAmount
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
startAt
Starting Position specification - For ordered sources, specifies which FS to start at. Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted- Parameters:
fs
- a Feature Structure specifying a starting position.- Returns:
- the updated SelectFSs object
-
startAt
Starting Position specification - For ordered sources, specifies which FS to start at. Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted- Parameters:
fs
- a Feature Structure specifying a starting position.- Returns:
- the updated SelectFSs object
-
startAt
Starting Position specification - For Annotation Indexes, specifies which FS to start at. This method is incompatible withtypePriority()
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- Parameters:
begin
- the begin bound- Returns:
- the updated SelectFSs object
-
startAt
Starting Position specification - For Annotation Indexes, specifies which FS to start at.- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
startAt
Starting Position specification - A combination of startAt followed by a shift Requires an ordered index not necessarily AnnotationIndex, not necessarily sorted- Parameters:
fs
- a Feature Structure specifying a starting position.shift
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
startAt
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.- Parameters:
fs
- a Feature Structure specifying a starting position.shift
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
startAt
Starting Position specification - A combination of startAt followed by a shift Requires an Annotation Index.- Parameters:
begin
- the begin boundend
- the end boundshift
- the amount to shift; this many Feature Structures which normally would be returned are instead skipped.- Returns:
- the updated SelectFSs object
-
limit
Limits the number of Feature Structures returned by this select- Parameters:
n
- the maximum number of feature structures returned. This must be a value >= 0.- Returns:
- the updated SelectFSs object
-
at
Subselection - specifies selecting Feature Structures having the same begin and end - influenced by typePriority, positionUsesType, and useAnnotationEquals Requires an Annotation Index.- Parameters:
fs
- specifies the bounds.- Returns:
- the updated SelectFSs object
-
at
Subselection - specifies selecting Feature Structures having the same begin and end Requires an Annotation Index. - influenced by typePriority, positionUsesType, and useAnnotationEquals- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
coveredBy
Subselection - specifies selecting Feature Structures starting (and maybe ending) within a bounding Feature Structure - influenced by typePriority, positionUsesType, useAnnotationEquals, includeAnnotationsWithEndBeyondBounds Requires an Annotation Index.- Parameters:
fs
- specifies the bounds.- Returns:
- the updated SelectFSs object
-
coveredBy
Subselection - specifies selecting Feature Structures starting (and maybe ending) within a bounding Feature Structure Requires an Annotation Index.- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
covering
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.- Parameters:
fs
- specifies the bounds.- Returns:
- the updated SelectFSs object
-
covering
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.- Parameters:
begin
- the begin boundend
- the end bound- Returns:
- the updated SelectFSs object
-
between
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.
- Parameters:
fs1
- the beginning boundfs2
- the ending bound- Returns:
- the updated SelectFSs object
-
following
For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd();- Parameters:
annotation
- the Annotation to follow- Returns:
- the updated SelectFSs object
-
following
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.- Parameters:
position
- start following this position- Returns:
- the updated SelectFSs object
-
following
For AnnotationIndex, position to first Annotation whose begin >= fs.getEnd() and then adjust position by the offset- Parameters:
annotation
- start following this Annotation, adjusted for the offsetoffset
- positive or negative shift amount to adjust starting position- Returns:
- the updated SelectFSs object
-
following
For AnnotationIndex, position to first Annotation whose begin >= position and then adjust position by the offset.- 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
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.- Parameters:
annotation
- the Annotation to use as the position to start before.- Returns:
- the updated SelectFSs object
-
preceding
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.- Parameters:
position
- start following this position- Returns:
- the updated SelectFSs object
-
preceding
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)- 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
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)- Parameters:
position
- the position to start before.offset
- the offset adjustment, positive or negative. Positive moves backwards.- Returns:
- the updated SelectFSs object
-
fsIterator
FSIterator<T> fsIterator()- Returns:
- an FSIterator over the selection. The iterator is set up depending on preceding configuration calls to this SelectFSs instance.
-
asList
- Returns:
- a List object whose elements represent the selection.
-
asArray
- Parameters:
clazz
- the class of the type of the elements- Returns:
- a Array object representation of the elements of the selection.
-
get
T 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.- Returns:
- first element or null if empty
- Throws:
CASRuntimeException
- conditioned on nullOK == false, and null being returned or the selection is empty.
-
single
T single()- Returns:
- first element, verifying that the size of the selection is 1 (or maybe 0)
- Throws:
CASRuntimeException
- (conditioned on nullOK == false ) if element is null or if there is more than 1 element in the selection, or if the selection is empty
-
singleOrNull
T singleOrNull()- Returns:
- first element, which may be null, or null if selection is empty.
- Throws:
CASRuntimeException
- if there is more than 1 element in the selection.
-
get
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.
- Parameters:
offset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null
- Throws:
CASRuntimeException
- conditioned on nullOK == false, and null being returned or the selection is empty, or the offset positioning going outside the elements in the selection.
-
single
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.
- Parameters:
offset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null
- Throws:
CASRuntimeException
- 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) or (conditioned on nullOK == false) null being returned or the selection is empty, or the offset positioning going outside the elements in the selection.
-
singleOrNull
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.
- Parameters:
offset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null
- Throws:
CASRuntimeException
- 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)
-
get
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.- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
- Throws:
CASRuntimeException
- (conditioned on nullOK == false) null being returned or the selection is empty.
-
get
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.- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
- Throws:
CASRuntimeException
- (conditioned on nullOK == false) null being returned or the selection is empty.
-
single
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.- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned or (conditioned on nullOK == false) and null being returned or the selection is empty.
-
single
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.- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned or (conditioned on nullOK == false) and null being returned or the selection is empty.
-
singleOrNull
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.- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned
-
singleOrNull
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.- Parameters:
fs
- the positioning Feature Structure- Returns:
- first element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned
-
get
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.- 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
- Throws:
CASRuntimeException
- (conditioned on nullOK == false) null being returned or the selection is empty.
-
get
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.- 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
- Throws:
CASRuntimeException
- (conditioned on nullOK == false) null being returned or the selection is empty.
-
single
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.
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned or (conditioned on nullOK == false) null being returned or the selection is empty.
-
single
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.
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned or (conditioned on nullOK == false) null being returned or the selection is empty.
-
singleOrNull
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.
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element next to the one being returned
-
singleOrNull
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.
- Parameters:
fs
- the positioning Feature Structureoffset
- the offset adjustment, positive or negative.- Returns:
- the selected element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element next to the one being returned
-
get
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.- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotation- Returns:
- the selected element or null if empty
- Throws:
CASRuntimeException
- conditioned on nullOK == false, and null being returned or the selection is empty.
-
single
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.
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotation- Returns:
- the selected element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned or (conditioned on nullOK == false) null being returned or the selection is empty.
-
singleOrNull
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.
- Parameters:
begin
- the begin position of the temporary Annotationend
- the end position of the temporary Annotation- Returns:
- the selected element or null if empty
- Throws:
CASRuntimeException
- if, after positioning, there is another element following the one being returned
-
get
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.- 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
- Throws:
CASRuntimeException
- (conditioned on nullOK == false) if null being returned or the selection is empty.
-
single
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.
- 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
- Throws:
CASRuntimeException
- if, after positioning, there is another element next to the one being returned or (conditioned on nullOK == false) if null being returned or the selection is empty.
-
singleOrNull
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.
- 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
- Throws:
CASRuntimeException
- if, after positioning, there is another element next to the one being returned
-
spliterator
- Specified by:
spliterator
in interfaceBaseStream<T extends FeatureStructure,
Stream<T extends FeatureStructure>> - Specified by:
spliterator
in interfaceIterable<T extends FeatureStructure>
-
select
Use this static method to capture the generic argument- Type Parameters:
U
- generic type of index- Parameters:
index
- - the index to select over as a source- Returns:
- - a SelectFSs instance
-
forEach
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 interfaceStream<T extends FeatureStructure>
-
isEmpty
boolean isEmpty()- Returns:
- true if the selection is empty
-