- Inherits from:
- Object
- Declared in:
- DTable.h
Object
|
+---DTable
Class Description
The table collection stores objects in an 2d 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 (DTable.h)
Instance Variables
- private id *_objects
- the stored objects
- private int _columns
- the number of columns
- private int _rows
- the number of rows
- private long _length
- the length of the table
- Constructors
- - (DTable *) init
- Initialise an empty table
- Returns:
- the object
- - (DTable *) init :(int) columns :(int) rows
- Initialise a table with columns and rows
- Parameters:
- columns - the number of columns
rows - the number of rows
- Returns:
- the object
- Copy related methods
- - deepen
- Deepen a copy of the table
- Returns:
- the object
- Destructor
- - free
- (Deep) free the table (incl. the objects)
- Returns:
- the object
- - shallowFree
- Free the table, not the stored objects
- Returns:
- the object
- Member methods
- - (int) columns
- Return the number of columns
- Returns:
- the number of columns
- - (DTable *) columns :(int) columns
- Set the number of columns
- Parameters:
- columns - the number of columns
- Returns:
- the object
- - (BOOL) isValid :(int) col :(int) row
- Check if an index is valid
- Parameters:
- col - the column (0..)
row - the row (0..)
- Returns:
- is it valid ?
- - (long) length
- Return the length of the table (columns * rows)
- Returns:
- the length
- - (int) rows
- Return the number of rows
- Returns:
- the number of rows
- - (DTable *) rows :(int) rows
- Set the number of rows
- 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
- - (DTable *) each :(SEL) sel
- Perform a selector on each object in the table (row after row)
- Parameters:
- sel - the selector
- Returns:
- the object
- - (id) get :(int) col :(int) row
- Get an object from the table
- Parameters:
- col - the column (0..)
row - the row (0..)
- Returns:
- the object in the table (or nil)
- - (BOOL) has :(id) obj
- Check if an object is in the table
- Parameters:
- obj - the object to be checked
- Returns:
- is it in the table ?
- - (id) set :(int) col :(int) row :(id) obj
- Set an object in the table
- Parameters:
- col - the column (0..)
row - the row (0..)
obj - the object to be set
- Returns:
- the previous stored object in the table (or nil)
generated 08-Jan-2006 by ObjcDoc 3.0.0