eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'IteratorStream':

Home

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

Class: IteratorStream


Inheritance:

   Object
   |
   +--Stream
      |
      +--PeekableStream
         |
         +--IteratorStream
            |
            +--RecursiveSeriesStream

Package:
stx:libbasic2
Category:
Streams
Version:
rev: 1.2 date: 2019/11/19 13:30:10
user: cg
file: IteratorStream.st directory: libbasic2
module: stx stc-classLibrary: libbasic2

Description:


This is a pseudo stream, which generates values by using an iterator action;
this is a block which is called to generate the value to read.
The block gets the index (1..) as argument.


[instance variables:]

[class variables:]

copyright

COPYRIGHT (c) 2019 by Claus Gittinger All Rights Reserved This software is furnished under a license and may be used only in accordance with the terms of that license and with the inclusion of the above copyright notice. This software may not be provided or otherwise made available to, or used by, any other person. No title to or ownership of the software is hereby transferred.

example

|s| s := IteratorStream on:[:i | i]. s next:10. s next:10. s := IteratorStream on:[:i | i*2]. s next:10.

Class protocol:

instance creation
o  on: aBlock


Instance protocol:

accessing
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)

o  contentsSpecies: aCollectionClass

o  iterator: aOneArgBlock

o  position

o  position: newPosition

initialization
o  initialize
(comment from inherited method)
just to ignore initialize to objects which do not need it

reading
o  next
return the next element from the stream by evaluating the nextBlock



ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 08:29:12 GMT