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 ContextAction
Context action of theconcat
operator.static 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.PsyObject
PSY_CLONE, PSY_EQ, PSY_HASHCODE, PSY_INSTANCEOF, PSY_NE, PSY_TONAME, PSY_TOSTRING, 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 TypeMethodDescriptiondefault void
psyClose()
Closes thisformalstream
.default PsyFormalStream<T>
psyConcat
(PsyFormalStream<T> oStream) default PsyInteger
psyCount()
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 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 oCount 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, psyToName, psyToString, 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_CONCAT
Context action of theconcat
operator. -
PSY_SORTED
Context action of thesorted
operator.
-
-
Method Details
-
psyStream
- Specified by:
psyStream
in 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:
psyClose
in interfacePsyCloseable
-
psyConcat
-
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 skipped stream.
- Throws:
PsyRangeCheckException
- when oCount is negative.
-
psyLimited
Returns aformalstream
consisting 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:
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
-
stream
-