|
|
6.77 Interval
- Defined in namespace Smalltalk
- Category: Collections-Sequenceable
- My instances represent ranges of objects, typically Number type
objects. I provide iteration/enumeration messages for producing all the
members that my instance represents.
6.77.1 Interval class: instance creation
- from: startInteger to: stopInteger
- Answer an Interval going from startInteger to the stopInteger, with a step of 1
- from: startInteger to: stopInteger by: stepInteger
- Answer an Interval going from startInteger to the stopInteger, with a step of stepInteger
- withAll: aCollection
- Answer an Interval containing the same elements as aCollection. Fail if it is not possible to create one.
6.77.2 Interval: basic
- at: index
- Answer the index-th element of the receiver.
- at: index put: anObject
- This method should not be called for instances of this class.
- collect: aBlock
- Evaluate the receiver for each element in aBlock, collect in an array the result of the evaluations.
- do: aBlock
- Evaluate the receiver for each element in aBlock
- reverse
- Answer a copy of the receiver with all of its items reversed
- size
- Answer the number of elements in the receiver.
- species
- Answer `Array'.
6.77.3 Interval: printing
- printOn: aStream
- Print a representation for the receiver on aStream
6.77.4 Interval: storing
- storeOn: aStream
- Store Smalltalk code compiling to the receiver on aStream
6.77.5 Interval: testing
- = anInterval
- Answer whether anInterval is the same interval as the receiver
- hash
- Answer an hash value for the receiver
|