Back: Interval-testing Up: Base classes Forward: Iterable class-multibyte encodings   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

1.92 Iterable

Defined in namespace Smalltalk
Superclass: Object
Category: Collections
I am an abstract class. My instances are collections of objects that can be iterated. The details on how they can be mutated (if at all possible) are left to the subclasses.

1.92.1 Iterable class: multibyte encodings  (class)
1.92.2 Iterable: enumeration  (instance)
1.92.3 Iterable: streaming  (instance)


1.92.1 Iterable class: multibyte encodings

isUnicode
Answer true; the receiver is able to store arbitrary Unicode characters.


1.92.2 Iterable: enumeration

, anIterable
Answer an iterable that enumerates first the elements of the receiver and then the elements of anIterable.

allSatisfy: aBlock
Search the receiver for an element for which aBlock returns false. Answer true if none does, false otherwise.

anySatisfy: aBlock
Search the receiver for an element for which aBlock returns true. Answer true if some does, false otherwise.

collect: aBlock
Answer a new instance of a Collection containing all the results of evaluating aBlock passing each of the receiver's elements

conform: aBlock
Search the receiver for an element for which aBlock returns false. Answer true if none does, false otherwise.

contains: aBlock
Search the receiver for an element for which aBlock returns true. Answer true if some does, false otherwise.

count: aBlock
Count the elements of the receiver for which aBlock returns true, and return their number.

detect: aBlock
Search the receiver for an element for which aBlock returns true. If some does, answer it. If none does, fail

detect: aBlock ifNone: exceptionBlock
Search the receiver for an element for which aBlock returns true. If some does, answer it. If none does, answer the result of evaluating aBlock

do: aBlock
Enumerate each object of the receiver, passing them to aBlock

do: aBlock separatedBy: separatorBlock
Enumerate each object of the receiver, passing them to aBlock. Between every two invocations of aBlock, invoke separatorBlock

fold: binaryBlock
First, pass to binaryBlock the first and second elements of the receiver; for each subsequent element, pass the result of the previous evaluation and an element. Answer the result of the last invocation, or the first element if the collection has size 1. Fail if the collection is empty.

inject: thisValue into: binaryBlock
First, pass to binaryBlock thisValue and the first element of the receiver; for each subsequent element, pass the result of the previous evaluation and an element. Answer the result of the last invocation.

noneSatisfy: aBlock
Search the receiver for an element for which aBlock returns true. Answer true if none does, false otherwise.

reject: aBlock
Answer a new instance of a Collection containing all the elements in the receiver which, when passed to aBlock, don't answer true

select: aBlock
Answer a new instance of a Collection containing all the elements in the receiver which, when passed to aBlock, answer true


1.92.3 Iterable: streaming

nextPutAllOn: aStream
Write all the objects in the receiver to aStream

readStream
Return a stream with the same contents as the receiver.



Back: Iterable-enumeration Up: Iterable Forward: LargeArray   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on August, 19 2010 using texi2html