OLBitIterator Class Reference
[Iterators]

An iterator that can traverse an array of bits. More...

#import <ObjectiveLib/Vector.h>

Inheritance diagram for OLBitIterator:

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 the value of object to the bit to which this iterator refers.
(id) - copy
 Make a copy of this iterator.
(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

OLBitIteratorBase base
 The base structure for bit iterators.

Detailed Description

An iterator that can traverse an array of bits.

This is a random access iterator that is used to traverse elements in a boolean vector.

See also:
OLBoolVector


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 the value of object to the bit to which this iterator refers.

The bit at the current position will be replaced with a 1 if the message boolValue returns YES, or 0 otherwise.

Precondition:
object must respond to the message boolValue.
Parameters:
object the object to assign
Returns:
a reference to this iterator

Reimplemented from OLIterator.

- (id) copy  

Make a copy of this iterator.

Returns:
a copy of this iterator

Reimplemented from OLIterator.

- (id) dereference  

Dereference the iterator.

Return an object that responds to the message boolValue. The underlying objects are shared by all bit iterators, so there is no significant memory allocation that occurs with the use of bit iterators.

Returns:
a reference to an object that responds to boolValue

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

- (OLBitIteratorBase) base [protected]

The base structure for bit iterators.


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