#import <ObjectiveLib/Iterator.h>
Inheritance diagram for OLArrayIterator:
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) | - 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. | |
Initializers and Deallocators | |
(id) | - initWithPointer: |
Initialize the iterator with the given pointer. | |
Static Public Member Functions | |
(OLPair *) | + pairWithPointer:andPointer: |
Return a pair of array iterators. | |
(OLPair *) | + pairWithPointer:distance: |
Return a pair of array iterators. | |
Protected Attributes | |
id * | current |
The object to which this iterator currently points. |
This is a random access iterator that can be used to traverse arbitrary arrays of ids.
- (id) advance |
Advance the iterator.
After advancing the iterator will point to a position in the container one step beyond the previous position.
Reimplemented from OLForwardIterator.
- (id) advanceBy: | (int) | count |
Advance or reverse the iterator by a given number of positions.
count | the number of positions to move the iterator, either forward or backward |
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.
object | the object to assign |
Reimplemented from OLIterator.
- (id) copy |
- (id) dereference |
Dereference the iterator.
Return the id of the object to which this iterator points.
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..
other | the iterator for which to compute the distance from this one |
Reimplemented from OLRandomAccessIterator.
- (id) initWithPointer: | (id *) | ptr |
Initialize the iterator with the given pointer.
The iterator will not attempt to take ownership of the pointer, as iterators never own the objects to which they point.
ptr | the pointer at the beginning of the array |
- (BOOL) isEqual: | (id) | object |
Return whether this object is equal to another one.
object | the object to test |
Reimplemented from OLIterator.
+ (OLPair*) pairWithPointer: | (id *) | p1 | ||
andPointer: | (id *) | p2 | ||
Return a pair of array iterators.
p1 | the first pointer in the range covered by the pair | |
p2 | the second pointer in the range covered by the pair |
+ (OLPair*) pairWithPointer: | (id *) | p | ||
distance: | (unsigned) | count | ||
Return a pair of array iterators.
p | the pointer at the beginning of the desired range | |
count | the number of objects that should be included in the range |
- (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.
Reimplemented from OLBidirectionalIterator.
- (id*) current [protected] |
The object to which this iterator currently points.
|