addObject: |
Append a new object to the end of the receiver.
-(void) addObject:(id) anObject;
anObject
- The object to be inserted.
Requires: anObject be non-nil and that the number of items in the
list can be expressed by an unsigned integer.
Guarantees: anObject will be appended to the last position in the
linked list. The effect is the same as performing an insertion at
the last position.
addObjectAtBeginning: |
Append a new object to the end of the receiver.
-(void) addObjectAtBeginning:(id) anObject;
anObject
- The object to be inserted.
Requires: anObject be non-nil and that the number of items in the
list can be expressed by an unsigned integer.
Guarantees: anObject will be inserted at the beginning of the
linked list. The effect is the same as performing an insertion at
the beginning using insertObject:atIndex:.
count |
Returns the number of objects currently in the receiver.
-(unsigned int) count;
Requires: None.
Guarantees: The object count is correctly returned.
insertObject:atIndex: |
Insert a new object at an arbitrary position in the receiver.
-(void) insertObject:(id) anObject atIndex:(unsigned int) insertionIndex;
anObject
- The object to be inserted.
insertionIndex
- The zero-based index at which the object is to be inserted.
Requires: anObject be non-nil, insertionIndex
is less than or equal to count and is greater than or equal to zero,
and that the number of items in the list can be expressed by an unsigned
integer.
Guarantees: anObject will be inserted at index insertionIndex.
Objects with an index less than insertionIndex will retain their
current index while those at and following this point will have their
index increased by one.
objectAtIndex: |
Returns a specified item from the receiver.
-(id) objectAtIndex:(unsigned int) fetchIndex;
fetchIndex
- The index of the item to be returned.
Requires: The index is a non-negative number that is strictly less than
the number of objects in the receiver.
Guarantees: The object with the corresponding index is correctly returned.
objectEnumerator |
Returns an NSEnumerator to iterate over objects in this list.
-(NSEnumerator*) objectEnumerator;
Requires: None.
Guarantees: An NSEnumerator is returned that iterates over all objects
if the list is not modified during traversal.
removeFirstObject |
Remove the first object in the reciever.
-(void) removeFirstObject;
Requires: None.
Guarantees: The object with a zero-based index of 0 is removed
with all subsequent objects having their indices decremented by one.
If no such object exists, nil is returned.
removeFromIndex: |
Remove an object from an arbitrary position in the receiver.
-(void) removeFromIndex:(unsigned int) removalIndex;
removalIndex
- The zero-based index at which an object is to be deleted.
Requires: The removalIndex is a non-negative integer that is
strictly less than count.
Guarantees: The object with a zero-based index of removalIndex is removed
with all subsequent objects having their indices decremented by one.
removeLastObject |
Remove the last object in the receiver.
-(void) removeLastObject;
Requires: There must be at least one object on the list.
Guarantees: The last object in the list is removed.
If no such object exists, nil is returned.
(Last Updated March 09, 2007)