OLRandomAccessIterator Class Reference
[Iterators]

An iterator that provides random access. More...

#import <ObjectiveLib/Iterator.h>

Inheritance diagram for OLRandomAccessIterator:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(id) - advanceBy:
 Advance or reverse the iterator by a given number of positions.
(int) - difference:
 Compute the number of positions that lie between this iterator and another one.

Detailed Description

An iterator that provides random access.

The iterator can be made to refer to any member of a collection with one operation.


Member Function Documentation

- (id) advanceBy: (int)  count  

Advance or reverse the iterator by a given number of positions.

Parameters:
count the number of positions to move the iterator, either forward or backward
Returns:
a reference to this iterator

Reimplemented in OLDequeIterator, OLArrayIterator, and OLBitIterator.

- (int) difference: (OLRandomAccessIterator *)  other  

Compute the number of positions that lie between this iterator and another one.

If other is after this iterator in the collection, the result will be negative, otherwise the result will be greater than or equal to zero..

Precondition:
Both iterators must refer to the same collection.
Parameters:
other the iterator for which to compute the distance from this one
Returns:
the number of positions that lie between this iterator and the other one

Reimplemented in OLDequeIterator, OLArrayIterator, and OLBitIterator.


The documentation for this class was generated from the following file:
ObjectiveLibGenerated Sun Apr 22 15:19:00 2007, © 2004-2007 Will Mason
SourceForge.net Logo