eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SelectingReadStream':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: SelectingReadStream


Inheritance:

   Object
   |
   +--Stream
      |
      +--SelectingReadStream

Package:
stx:libbasic2
Category:
Streams-Misc
Version:
rev: 1.5 date: 2014/04/30 18:20:55
user: cg
file: SelectingReadStream.st directory: libbasic2
module: stx stc-classLibrary: libbasic2
Author:
Claus Gittinger

Description:


A stream which only delivers elements for which a select block returns true
from an underlying stream. 

Needs readAhead for proper atEnd handling.


[instance variables:]
    hasReadAhead        - because nil is a valid read-element,
                        this is used to know if readAhead is valid.


Class protocol:

instance creation
o  on: aStream selecting: aBlock


Instance protocol:

instance creation
o  on: aStream selecting: aBlock

queries
o  atEnd

o  contentsSpecies
return a class of which instances will be returned, when
parts of the collection are asked for.
(see upTo-kind of methods in Stream)

reading
o  next


Examples:


|s| s := SelectingReadStream on:#(1 2 3 4 5 6 7 8) readStream selecting:[:each | each even]. s upToEnd

ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Fri, 19 Apr 2024 01:12:52 GMT