ObjectiveLib  1.0.0
Public Member Functions | Protected Attributes
OLReverseBidiIterator Class Reference

A class to reverse the behavior of a given iterator. More...

#import <ObjectiveLib/Iterator.h>

Inheritance diagram for OLReverseBidiIterator:
Inheritance graph
[legend]

List of all members.

Public Member Functions

(id) - advance
 Advance the iterator.
(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.
(BOOL) - isEqual:
 Return whether this object is equal to another one.
(id) - reverse
 Reverse the iterator.
Initializers and Deallocators
(id) - initWithIterator:
 Initialize the iterator with its target.
(void) - dealloc
 Finalize the iterator and deallocate any allocated memory.

Protected Attributes

OLBidirectionalIteratorcurrent
 The target iterator on which this iterator performs its operations.

Detailed Description

A class to reverse the behavior of a given iterator.

All operations are performed on the the iterator that is passed to this iterator. However, they are reversed: advance (OLReverseBidiIterator) causes the target iterator to reverse, and so forth.


Member Function Documentation

- (id) advance

Advance the iterator.

This has the effect of reversing the underlying target iterator by one step.

Returns:
a reference to this iterator

Reimplemented from OLForwardIterator.

- (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:
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.

Reimplemented in OLReverseRandomIterator.

- (void) dealloc

Finalize the iterator and deallocate any allocated memory.

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

Initialize the iterator with its target.

Parameters:
itorthe iterator on which to perform operations
Returns:
a reference to this iterator
- (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.

Reimplemented in OLReverseRandomIterator.

- (id) reverse

Reverse the iterator.

This has the effect of advancing the underlying target iterator by one step.

Returns:
a reference to this iterator

Reimplemented from OLBidirectionalIterator.


Member Data Documentation

- (OLBidirectionalIterator*) current [protected]

The target iterator on which this iterator performs its operations.


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

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