Package coneforest.psylla.core
Interface PsyFormalStream<T extends PsyObject>
-
- All Superinterfaces:
PsyCloseable,PsyConvertableToName,PsyConvertableToString,PsyObject,PsySequential<T>,PsyStreamable<T>
public interface PsyFormalStream<T extends PsyObject> extends PsyStreamable<T>, PsyCloseable
-
-
Field Summary
Fields Modifier and Type Field Description static PsyOperator[]OPERATORS
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidpsyClose()Closes thisformalstream.default PsyFormalStream<T>psyConcat(PsyFormalStream<T> oStream)default PsyIntegerpsyCount()Returns the count of elements in thisformalstream.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 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>psyStream()Stream<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 Detail
-
OPERATORS
static final PsyOperator[] OPERATORS
-
-
Method Detail
-
psyStream
default PsyFormalStream<T> psyStream()
- Specified by:
psyStreamin interfacePsyStreamable<T extends PsyObject>
-
psyCount
default PsyInteger psyCount()
Returns the count of elements in thisformalstream.- Returns:
- a count
-
psyClose
default void psyClose()
Closes thisformalstream.- Specified by:
psyClosein interfacePsyCloseable
-
psyConcat
default PsyFormalStream<T> psyConcat(PsyFormalStream<T> oStream)
-
psyMapped
default PsyFormalStream<PsyObject> psyMapped(PsyExecutable oMapper, PsyContext oContext) throws PsyException
- Throws:
PsyException
-
psySorted
default PsyFormalStream<T> psySorted(PsyExecutable oComparator, PsyContext oContext)
-
psySkipped
default PsyFormalStream<T> psySkipped(PsyInteger oCount) throws PsyRangeCheckException
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
default PsyFormalStream<T> psyLimited(PsyInteger oCount) throws PsyRangeCheckException
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
-
psyFiltered
default PsyFormalStream<T> psyFiltered(PsyExecutable oPredicate, PsyContext oContext) throws PsyException
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:
PsyException
-
psyForAll
default void psyForAll(PsyObject oProc, PsyContext oContext) throws PsyException
- Specified by:
psyForAllin interfacePsySequential<T extends PsyObject>- Specified by:
psyForAllin interfacePsyStreamable<T extends PsyObject>- Throws:
PsyException
-
psyReduce
default T psyReduce(T oIdentity, PsyExecutable oAccumulator, PsyContext oContext) throws PsyException
- Throws:
PsyException
-
-