Next: , Previous: , Up: Stream   [Index]


1.157.11 Stream: filtering

, anIterable

Answer a new stream that concatenates the data in the receiver with the data in aStream. Both the receiver and aStream should be readable.

collect: aBlock

Answer a new stream that will pass the returned objects through aBlock, and return whatever object is returned by aBlock instead. Note that when peeking in the returned stream, the block will be invoked multiple times, with possibly surprising results.

lines

Answer a new stream that answers lines from the receiver.

peek

Returns the next element of the stream without moving the pointer. Returns nil when at end of stream. Lookahead is implemented automatically for streams that are not positionable but can be copied.

peekFor: aCharacter

Returns true and gobbles the next element from the stream of it is equal to anObject, returns false and doesn’t gobble the next element if the next element is not equal to anObject. Lookahead is implemented automatically for streams that are not positionable but can be copied.

reject: aBlock

Answer a new stream that only returns those objects for which aBlock returns false. Note that the returned stream will not be positionable.

select: aBlock

Answer a new stream that only returns those objects for which aBlock returns true. Note that the returned stream will not be positionable.