Squeak Class Documentation category index | class index  
 
MappedCollection
  category: Collections-Sequenceable
  superclass: SequenceableCollection
  subclasses:

I represent an access mechanism for a sequencable collection re-ordering or filtering its elements.

instance methods
  accessing
  at:
at:put:
contents
size

  adding
  add:

  copying
  copy

  enumerating
  collect:
do:
select:

  printing
  storeOn:

  private
  setCollection:map:
species

class methods
  instance creation
  collection:map:
new
newFrom:

instance methods
  accessing top  
 

at:

Primitive. Assumes receiver is indexable. Answer the value of an
indexable element in the receiver. Fail if the argument index is not an
Integer or is out of bounds. Essential. See Object documentation
whatIsAPrimitive.


 

at:put:

Primitive. Assumes receiver is indexable. Store the argument value in
the indexable element of the receiver indicated by index. Fail if the
index is not an Integer or is out of bounds. Or fail if the value is not of
the right type for this kind of collection. Answer the value that was
stored. Essential. See Object documentation whatIsAPrimitive.


 

contents

Answer the receiver's domain for mapping, a Dictionary or
SequenceableCollection.


 

size

Answer how many elements the receiver contains.


  adding top  
 

add:

Include newObject as one of the receiver's elements. Answer newObject.
ArrayedCollections cannot respond to this message.


  copying top  
 

copy

This returns another MappedCollection whereas copyFrom:to: will return
an object like my domain.


  enumerating top  
 

collect:

Refer to the comment in Collection|collect:.


 

do:

Refer to the comment in Collection|do:.


 

select:

Refer to the comment in Collection|select:.


  printing top  
 

storeOn:

Refer to the comment in Object|storeOn:.


  private top  
 

setCollection:map:


 

species

Answer the preferred class for reconstructing the receiver. For example,
collections create new collections whenever enumeration messages such as
collect: or select: are invoked. The new kind of collection is determined by
the species of the original collection. Species and class are not always the
same. For example, the species of Interval is Array.


class methods
  instance creation top  
 

collection:map:

Answer an instance of me that maps aCollection by
aSequenceableCollection.


 

new

Answer a new instance of the receiver (which is a class) with no indexable variables. Fail if the class is indexable.


 

newFrom:

Answer an instance of me containing the same elements as aCollection.