OLDequeIterator Class Reference
[Iterators]

An iterator that knows about double-ended queues. More...

#import <ObjectiveLib/Deque.h>

Inheritance diagram for OLDequeIterator:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(id) - advance
 Advance the iterator.
(id) - advanceBy:
 Advance or reverse the iterator by a given number of positions.
(id) - assign:
 Assign an object to the position in the controlled sequence to which this iterator refers.
(id) - copyWithZone:
 Make a copy of this iterator allocating memory from zone.
(id) - dereference
 Dereference the iterator.
(int) - difference:
 Compute the number of positions that lie between this iterator and another one.
(BOOL) - isEqual:
 Return whether this object is equal to another one.
(id) - reverse
 Reverse the iterator by one position.

Protected Attributes

id * current
 The current object in view.
id * first
 The first valid item in this node of the deque.
id * last
 The last valid item in this node of the deque.
id ** node
 The node currently in view.

Detailed Description

An iterator that knows about double-ended queues.

This is a basic random access iterator that is specialized to understand queues.

See also:
OLDeque


Member Function Documentation

- (id) advance  

Advance the iterator.

After advancing the iterator will point to a position in the container one step beyond the previous position.

Returns:
a reference to this iterator

Reimplemented from OLForwardIterator.

- (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 from OLRandomAccessIterator.

- (id) assign: (id)  object  

Assign an object to the position in the controlled sequence to which this iterator refers.

The object currently at the position will be removed and replaced with the given object.

Parameters:
object the object to assign
Returns:
a reference to this iterator

Reimplemented from OLIterator.

- (id) copyWithZone: (NSZone *)  zone  

Make a copy of this iterator allocating memory from zone.

Parameters:
zone the zone from which to allocate memory
Returns:
a copy of this iterator

Reimplemented from OLIterator.

- (id) dereference  

Dereference the iterator.

Return the id of the object to which this iterator points.

Returns:
the id of the referenced object

Reimplemented from OLIterator.

- (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 from OLRandomAccessIterator.

- (BOOL) isEqual: (id)  object  

Return whether this object is equal to another one.

Parameters:
object the object to test
Returns:
YES if the iterator is equal to the object, NO if not

Reimplemented from OLIterator.

- (id) reverse  

Reverse the iterator by one position.

After reversing the iterator will point to a position in the container one step before the previous position.

Returns:
a reference to this iterator

Reimplemented from OLBidirectionalIterator.


Member Data Documentation

- (id*) current [protected]

The current object in view.

- (id*) first [protected]

The first valid item in this node of the deque.

- (id*) last [protected]

The last valid item in this node of the deque.

- (id**) node [protected]

The node currently in view.


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