- Inherits from:
- Object
- Declared in:
- DArray.h
Object
|
+---DArray
Class Description
The array collection stores objects in an array that can grow. Objects
can be accessed by an index. Due to the easy access there is no iterator.
- Last modified:
- 31-Oct-2007 (DArray.h)
Instance Variables
- private id *_objects
- the stored objects
- private long _length
- the length of the array
- Constructors
- - (DArray *) init
- Initialise to an empty array
- Returns:
- the object
- - (DArray *) init :(long) length
- Initialise to an array with an initial length
- Parameters:
- length - the length of the array
- Returns:
- the object
- Copy related methods
- - deepen
- Deepen a copy of the array
- Returns:
- the object
- - shallowCopy
- Do a shallow copy of the array
- Returns:
- the object
- Destructor
- - free
- (Deep) free the array (incl. the objects)
- Returns:
- the object
- - shallowFree
- Free the array, not the stored objects
- Returns:
- the object
- Member methods
- - (BOOL) isValid :(long) index
- Test if an index is valid
- Parameters:
- index - the index to be tested
- Returns:
- is it valid ?
- - (long) length
- Return the length of the array
- Returns:
- the length
- - (DArray *) length :(long) length
- Set the length for the array
- Parameters:
- length - the new length
- Returns:
- the object
- Main methods
- - (id) get :(long) index
- Get an object from the array
- Parameters:
- index - the index in the array
- Returns:
- the object in the array (or nil)
- - (id) set :(long) index :(id) obj
- Set an object in the array
- Parameters:
- index - the index in the array
obj - the object to be set
- Returns:
- the previous object in the array (or nil)
- Object location 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
- - (DArray *) each :(SEL) sel
- Perform a selector on each object in the array
- Parameters:
- sel - the selector
- Returns:
- the object
- - (BOOL) has :(id) obj
- Test if an object is in an array
- Parameters:
- obj - the object to be checked
- Returns:
- is it in the array ?
- - (long) index :(id) obj
- Find the first occurence of an object
- Parameters:
- obj - the object to be found
- Returns:
- the first occurence of the object (or -1 for not found)
- - (long) rindex :(id) obj
- Find the last occurence of an object
- Parameters:
- obj - the object to be found
- Returns:
- the last occurence of the object (or -1 for not found)
generated 05-Nov-2007 by ObjcDoc 3.0.0