- Inherits from:
- Object
- Declared in:
- DCube.h
Object
|
+---DCube
Class Description
The cube collection stores objects in a 3d array that can grow.
Objects can be accessed by an index. Due to the easy access there
is no iterator.
- Last modified:
- 27-Feb-2005 (DCube.h)
Instance Variables
- private id *_objects
- the stored objects
- private int _columns
- the number of columns
- private int _rows
- the number of rows
- private int _layers
- the number of layers
- private long _length
- the length of the cube
- Constructors
- - (DCube *) init
- Initialise an empty cube
- Returns:
- the object
- - (DCube *) init :(int) columns :(int) rows :(int) layers
- Initialise a cube with columns, rows and layers
- Parameters:
- columns - the number of columns
rows - the number of rows
layers - the number of layers
- Returns:
- the object
- Copy related methods
- - deepen
- Deepen a copy of the cube
- Returns:
- the object
- Destructor
- - free
- (Deep) free the cube (incl. the stored objects)
- Returns:
- the object
- - shallowFree
- Free the cube, not the stored objects
- Returns:
- the object
- Member methods
- - (int) columns
- Return the number of columns
- Returns:
- the number of columns
- - (DCube *) columns :(int) columns
- Set the number of columns (only growth)
- Parameters:
- columns - the number of columns
- Returns:
- the object
- - (BOOL) isValid :(int) col :(int) row :(int) layer
- Check if an index is valid
- Parameters:
- col - the column (0..)
row - the row (0..)
layer - the layer (0..)
- Returns:
- is it valid ?
- - (int) layers
- Return the number of layers
- Returns:
- the number of layers
- - (DCube *) layers :(int) layers
- Set the number of layers (only growth)
- Parameters:
- layers - the number of layers
- Returns:
- the object
- - (long) length
- Return the length of the cube (columns * rows * layers)
- Returns:
- the length
- - (int) rows
- Return the number of rows
- Returns:
- the number of rows
- - (DCube *) rows :(int) rows
- Set the number of rows (only growth)
- Parameters:
- rows - the number of rows
- Returns:
- the object
- Main methods
- - (long) count :(id) obj
- Count the number of occurences of an object
- Parameters:
- obj - the object to be counted
- Returns:
- the number of occurences
- - (DCube *) each :(SEL) sel
- Perform a selector on each object in the cube
- Parameters:
- sel - the selector
- Returns:
- the object
- - (id) get :(int) col :(int) row :(int) layer
- Get an object from the cube
- Parameters:
- col - the column (0..)
row - the row (0..)
layer - the layer (0..)
- Returns:
- the object in the cube (or nil)
- - (BOOL) has :(id) obj
- Check if an object is in the cube
- Parameters:
- obj - the object
- Returns:
- is it in the cube ?
- - (id) set :(int) col :(int) row :(int) layer :(id) obj
- Set an object in the cube
- Parameters:
- col - the column (0..)
row - the row (0..)
layer - the layer (0..)
obj - the object to be set
- Returns:
- the previous stored object in the cube (or nil)
generated 08-Jan-2006 by ObjcDoc 3.0.0