ObjectiveLib  1.0.0
Public Member Functions
OLRandomAccessIterator Class Reference

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:
countthe number of positions to move the iterator, either forward or backward
Returns:
a reference to this iterator

Reimplemented in OLArrayIterator, OLBitIterator, and OLDequeIterator.

- (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:
otherthe 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 OLArrayIterator, OLBitIterator, and OLDequeIterator.


The documentation for this class was generated from the following file:

ObjectiveLibGenerated Sat Feb 15 2014 07:45:35, © 2004-2007 Will Mason