Squeak Class Documentation category index | class index  
 
Array2D
  category: Collections-Arrayed
  superclass: ArrayedCollection
  subclasses:

A simple 2D-Array implementation.

Neither storing nor sorting (otherwise inherited from ArrayedCollection) will work. Neither comparing nor most accessing mehods inherited from Sequenceable collection will work. Actually, it's a bad idea to inherit this class from collection at all!

instance methods
  accessing
  at:at:
at:at:add:
at:at:put:
atAllPut:
extent
height
size
width

  accessing rows/columns
  atCol:
atCol:put:
atRow:
atRow:put:

  converting
  asArray

  copying
  copy

  enumeration
  do:
rowAndColumnValuesDo:
rowsAndColumnsDo:

  private
  extent:fromArray:
indexX:y:
setContents:
width:height:type:

class methods
  instance creation
  extent:
new
new:
width:height:
width:height:type:

instance methods
  accessing top  
 

at:at:

Answer the element at index x,y.


 

at:at:add:

Add value (using #+) to the existing element at index x,y.


 

at:at:put:

Store value at index x,y and answer it.


 

atAllPut:

Put anObject at every one of the receiver's indices.


 

extent

Answer the receiver's dimensions as point.


 

height

Answer the receiver's second dimension.


 

size

Answer how many elements the receiver contains.


 

width

Answer the receiver's first dimension.


  accessing rows/columns top  
 

atCol:

Answer a whole column.


 

atCol:put:

Put in a whole column.


 

atRow:

Answer a whole row.


 

atRow:put:

Put in a whole row.


  converting top  
 

asArray

Answer an Array whose elements are the elements of the receiver.


  copying top  
 

copy

Answer another instance just like the receiver. Subclasses typically
override this method; they typically do not override shallowCopy.


  enumeration top  
 

do:

Iterate with X varying most quickly. 6/20/96 tk


 

rowAndColumnValuesDo:


 

rowsAndColumnsDo:


  private top  
 

extent:fromArray:

Load receiver up from a 1-D array. X varies most quickly. 6/20/96 tk


 

indexX:y:


 

setContents:


 

width:height:type:

Set the number of elements in the first and second dimension.
collectionClass can be Array or String or ByteArray.


class methods
  instance creation top  
 

extent:


 

new

Override ArrayedCollection. 6/20/96 tk


 

new:

Answer an instance of this class with the number of indexable
variables specified by the argument, sizeRequested.


 

width:height:


 

width:height:type: