OLInsertIterator Class Reference
[Insert Iterators]

An iterator that can be used to insert items into a container. More...

#import <ObjectiveLib/Iterator.h>

Inheritance diagram for OLInsertIterator:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(id) - assign:
 Insert object just before the last insertion, or just before the iterator passed to the initializer if it is the first insertion.
(id) - copy
 Make a copy of this iterator.
(BOOL) - isEqual:
 Return whether this object is equal to another one.
Initializers and Deallocators
(id) - free
 Finalize the iterator and deallocate any allocated memory.
(id) - initWithInserter:iterator:
 Initialize the iterator with the given container and iterator.

Protected Attributes

id< OLInsertercontainer
 The container into which to insert items.
OLForwardIteratoriterator
 An iterator for keeping track of where the next insertion should take place.

Detailed Description

An iterator that can be used to insert items into a container.

The iterator's assign: (OLInsertIterator) message inserts the object to be assigned at the position identified by another iterator that is passed during intialization. The insertion will always take place just before the last point of insertion.


Member Function Documentation

- (id) assign: (id)  object  

Insert object just before the last insertion, or just before the iterator passed to the initializer if it is the first insertion.

Parameters:
object the object to insert
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) free  

Finalize the iterator and deallocate any allocated memory.

- (id) initWithInserter: (id< OLInserter >)  cnr
iterator: (OLForwardIterator *)  itor 

Initialize the iterator with the given container and iterator.

The container is the target of future insertions, and the iterator shows where in the container insertion should begin.

Precondition:
The iterator, itor, must refer to a position in the container, cnr.
Parameters:
cnr the container into which to insert items
itor the iterator showing the location of the first insertion
Returns:
a reference to this iterator

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


Member Data Documentation

- (id<OLInserter>) container [protected]

The container into which to insert items.

- (OLForwardIterator*) iterator [protected]

An iterator for keeping track of where the next insertion should take place.


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