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 ContextActionContext action of thecountoperator.static final ContextActionContext action of thedistinctoperator.static final ContextActionContext action of thefilteredoperator.static final ContextActionContext action of thelimitedoperator.static final ContextActionContext action of themappedoperator.static final ContextActionContext action of thepeekedoperator.static final ContextActionContext action of thereduceoperator.static final ContextActionContext action of theskippedoperator.static final ContextActionContext action of thesortedoperator.Fields inherited from interface coneforest.psylla.core.PsyCloseable
PSY_CLOSEFields inherited from interface coneforest.psylla.core.PsyConcatenable
PSY_CONCATFields inherited from interface coneforest.psylla.core.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TOSTRING, PSY_TOSTRINGBUFFER, PSY_TYPEFields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALLFields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM -
Method Summary
Modifier and TypeMethodDescriptionstatic <T1 extends PsyObject>
PsyFormalStream<T1> default voidpsyClose()Closes thisformalstream.default PsyFormalStream<T> psyConcat(PsyFormalStream<T> oStream) Returns theconcatenableresult of concatenation of this object and specified object.default PsyIntegerpsyCount()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 voidpsyForAll(PsyObject oProc, PsyContext oContext) default PsyFormalStream<T> psyLimited(PsyInteger oCount) Returns aformalstreamconsisting 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 TpsyReduce(T oIdentity, PsyExecutable oAccumulator, PsyContext oContext) default PsyFormalStream<T> psySkipped(PsyInteger oCount) Returns aformalstreamconsisting of the remaining elements of thisformalstreamafter 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 thecountoperator. -
PSY_DISTINCT
Context action of thedistinctoperator. -
PSY_FILTERED
Context action of thefilteredoperator. -
PSY_LIMITED
Context action of thelimitedoperator. -
PSY_MAPPED
Context action of themappedoperator. -
PSY_PEEKED
Context action of thepeekedoperator. -
PSY_REDUCE
Context action of thereduceoperator. -
PSY_SKIPPED
Context action of theskippedoperator. -
PSY_SORTED
Context action of thesortedoperator.
-
-
Method Details
-
of
-
psyStream
- Specified by:
psyStreamin 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:
psyClosein interfacePsyCloseable
-
psyConcat
Description copied from interface:PsyConcatenableReturns theconcatenableresult of concatenation of this object and specified object.- Specified by:
psyConcatin interfacePsyConcatenable<T extends PsyObject>- Parameters:
oStream- the specified object.- Returns:
- the
concatenableresult 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 aformalstreamconsisting of the remaining elements of thisformalstreamafter discarding the first oCount elements of the stream.- Parameters:
oCount- the number of leading elements to skip.- Returns:
- a
formalstreamconsisting of the remaining elements of thisformalstreamafter 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 aformalstreamconsisting 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
formalstreamconsisting 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:
psyForAllin interfacePsySequential<T extends PsyObject>- Specified by:
psyForAllin 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
-