ObjectiveLib  1.0.0
Public Member Functions | Protected Attributes
OLBitIterator Class Reference

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) - 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

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:
countthe 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:
objectthe 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:
zonethe zone from which to allocate memory
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:
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 from OLRandomAccessIterator.

- (BOOL) isEqual: (id)  object

Return whether this object is equal to another one.

Parameters:
objectthe 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 Sat Feb 15 2014 07:45:34, © 2004-2007 Will Mason