Package coneforest.psylla.core
Interface PsyFormalStream<T extends PsyObject>
- All Superinterfaces:
PsyCloseable
,PsyConvertableToName
,PsyConvertableToString
,PsyObject
,PsySequential<T>
,PsyStreamable<T>
-
Field Summary
Fields -
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
-
OPERATORS
-
-
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 predicateoContext
- a context in which a predicate is called- Returns:
- a filtered stream
- Throws:
PsyErrorException
-
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 PsyErrorException - Throws:
PsyErrorException
-
psyDistinct
-
stream
-