Module coneforest.psylla
Package coneforest.psylla.core
Interface PsyFormalStream<T extends PsyObject>
- All Superinterfaces:
PsyCloseable,PsyObject,PsySequential<T>,PsyStreamable<T>
@Type("formalstream")
public interface PsyFormalStream<T extends PsyObject>
extends PsyStreamable<T>, PsyCloseable
The representation of
formalstream, an abstraction of the stream.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ContextActionContext action of theconcatoperator.static 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.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, PSY_TYPEFields inherited from interface coneforest.psylla.core.PsySequential
PSY_FORALLFields inherited from interface coneforest.psylla.core.PsyStreamable
PSY_STREAM -
Method Summary
Modifier and TypeMethodDescriptiondefault voidpsyClose()Closes thisformalstream.default PsyFormalStream<T>psyConcat(PsyFormalStream<T> oStream) default PsyIntegerpsyCount()Returns the count of elements in thisformalstream.default PsyFormalStream<T>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 oCount 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, psyToName, psyToString, 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_CONCAT
Context action of theconcatoperator. -
PSY_SORTED
Context action of thesortedoperator.
-
-
Method Details
-
psyStream
- Specified by:
psyStreamin interfacePsyStreamable<T extends PsyObject>
-
psyCount
Returns the count of elements in thisformalstream.- Returns:
- a count
- Throws:
PsyInvalidStateException
-
psyClose
default void psyClose()Closes thisformalstream.- Specified by:
psyClosein interfacePsyCloseable
-
psyConcat
-
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 skipped stream.
- Throws:
PsyRangeCheckException- when oCount is negative.
-
psyLimited
Returns aformalstreamconsisting of the elements of thisformalstream, truncated to be no longer than oCount in length.- Parameters:
oCount- the number of elements the stream should be limited to.- Returns:
- a limited stream.
- Throws:
PsyRangeCheckException- when oCount is negative.
-
psyPeeked
default PsyFormalStream<T> psyPeeked(PsyExecutable oProc, PsyContext oContext) throws PsyRangeCheckException - Throws:
PsyRangeCheckException
-
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 filtered stream.
- 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
-
stream
-