Module coneforest.psylla
Package coneforest.psylla.core
Interface PsyFormalStream<T extends PsyObject>
- All Superinterfaces:
PsyCloseable
,PsyConcatenable<PsyFormalStream<T>>
,PsyObject
,PsySequential<T>
,PsyStreamable<T>
@Type("formalstream")
public interface PsyFormalStream<T extends PsyObject>
extends PsyStreamable<T>, PsyCloseable, PsyConcatenable<PsyFormalStream<T>>
The representation of
formalstream
, an abstraction of the stream.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextAction
Context action of thecount
operator.static final ContextAction
Context action of thedistinct
operator.static final ContextAction
Context action of thefiltered
operator.static final ContextAction
Context action of thelimited
operator.static final ContextAction
Context action of themapped
operator.static final ContextAction
Context action of thepeeked
operator.static final ContextAction
Context action of thereduce
operator.static final ContextAction
Context action of theskipped
operator.static final ContextAction
Context action of thesorted
operator.Fields inherited from interface coneforest.psylla.core.PsyCloseable
PSY_CLOSE
Fields inherited from interface coneforest.psylla.core.PsyConcatenable
PSY_CONCAT
Fields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TOSTRING, PSY_TOSTRINGBUFFER, PSY_TYPE
Fields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALL
Fields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T1 extends PsyObject>
PsyFormalStream<T1> default void
psyClose()
Closes thisformalstream
.default PsyFormalStream
<T> psyConcat
(PsyFormalStream<T> oStream) Returns theconcatenable
result of concatenation of this object and specified object.default PsyInteger
psyCount()
Returns the count of elements in thisformalstream
.default PsyFormalStream
<T> Returns a stream consisting of the distinct elements of this stream.default PsyFormalStream
<T> psyFiltered
(PsyExecutable oPredicate, PsyContext oContext) Returns a stream over elements of this stream that satisfies the given predicate.default void
psyForAll
(PsyObject oProc, PsyContext oContext) default PsyFormalStream
<T> psyLimited
(PsyInteger oCount) Returns aformalstream
consisting of the elements of thisformalstream
, truncated to be no longer than specified count in length.default PsyFormalStream
<PsyObject> psyMapped
(PsyExecutable oMapper, PsyContext oContext) default PsyFormalStream
<T> psyPeeked
(PsyExecutable oProc, PsyContext oContext) default T
psyReduce
(T oIdentity, PsyExecutable oAccumulator, PsyContext oContext) default PsyFormalStream
<T> psySkipped
(PsyInteger oCount) Returns aformalstream
consisting of the remaining elements of thisformalstream
after discarding the first oCount elements of the stream.default PsyFormalStream
<T> psySorted
(PsyExecutable oComparator, PsyContext oContext) default PsyFormalStream
<T> stream()
Methods inherited from interface coneforest.psylla.core.PsyObject
convert, execute, invoke, psyClone, psyEq, psyHashCode, psyInstanceOf, psyNe, psySyntax, psyToString, psyToStringBuffer, psyType, toSyntaxString, typeName
-
Field Details
-
PSY_COUNT
Context action of thecount
operator. -
PSY_DISTINCT
Context action of thedistinct
operator. -
PSY_FILTERED
Context action of thefiltered
operator. -
PSY_LIMITED
Context action of thelimited
operator. -
PSY_MAPPED
Context action of themapped
operator. -
PSY_PEEKED
Context action of thepeeked
operator. -
PSY_REDUCE
Context action of thereduce
operator. -
PSY_SKIPPED
Context action of theskipped
operator. -
PSY_SORTED
Context action of thesorted
operator.
-
-
Method Details
-
of
-
psyStream
- Specified by:
psyStream
in interfacePsyStreamable<T extends PsyObject>
-
psyCount
Returns the count of elements in thisformalstream
.- Returns:
- the count of elements in this
formalstream
- Throws:
PsyInvalidStateException
- when this stream is closed.
-
psyClose
default void psyClose()Closes thisformalstream
.- Specified by:
psyClose
in interfacePsyCloseable
-
psyConcat
Description copied from interface:PsyConcatenable
Returns theconcatenable
result of concatenation of this object and specified object.- Specified by:
psyConcat
in interfacePsyConcatenable<T extends PsyObject>
- Parameters:
oStream
- the specified object.- Returns:
- the
concatenable
result of concatenation of this object and specified object - Throws:
PsyInvalidStateException
-
psyMapped
default PsyFormalStream<PsyObject> psyMapped(PsyExecutable oMapper, PsyContext oContext) throws PsyErrorException - Throws:
PsyErrorException
-
psySorted
-
psySkipped
Returns aformalstream
consisting of the remaining elements of thisformalstream
after discarding the first oCount elements of the stream.- Parameters:
oCount
- the number of leading elements to skip.- Returns:
- a
formalstream
consisting of the remaining elements of thisformalstream
after discarding the first oCount elements of the stream - Throws:
PsyRangeCheckException
- when oCount is negative.
-
psyLimited
default PsyFormalStream<T> psyLimited(PsyInteger oCount) throws PsyRangeCheckException, PsyInvalidStateException Returns aformalstream
consisting of the elements of thisformalstream
, truncated to be no longer than specified count in length.- Parameters:
oCount
- the number of elements the stream should be limited to.- Returns:
- a
formalstream
consisting of the elements of thisformalstream
, truncated to be no longer than specified count in length - Throws:
PsyRangeCheckException
- when oCount is negative.PsyInvalidStateException
-
psyPeeked
default PsyFormalStream<T> psyPeeked(PsyExecutable oProc, PsyContext oContext) throws PsyRangeCheckException, PsyInvalidStateException -
psyFiltered
default PsyFormalStream<T> psyFiltered(PsyExecutable oPredicate, PsyContext oContext) throws PsyErrorException Returns a stream over elements of this stream that satisfies the given predicate.- Parameters:
oPredicate
- a predicate.oContext
- a context in which a predicate is called.- Returns:
- a stream over elements of this stream that satisfies the given predicate
- Throws:
PsyErrorException
- TODO
-
psyForAll
- Specified by:
psyForAll
in interfacePsySequential<T extends PsyObject>
- Specified by:
psyForAll
in interfacePsyStreamable<T extends PsyObject>
- Throws:
PsyErrorException
-
psyReduce
default T psyReduce(T oIdentity, PsyExecutable oAccumulator, PsyContext oContext) throws PsyInvalidStateException - Throws:
PsyInvalidStateException
-
psyDistinct
Returns a stream consisting of the distinct elements of this stream.- Returns:
- a stream consisting of the distinct elements of this stream
-
stream
-