ObjectiveLib  1.0.0
Public Member Functions | Protected Attributes
OLInsertIterator Class Reference

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) - copyWithZone:
 Make a copy of this iterator allocating memory from zone.
(BOOL) - isEqual:
 Return whether this object is equal to another one.
Initializers and Deallocators
(id) - initWithInserter:iterator:
 Initialize the iterator with the given container and iterator.
(void) - dealloc
 Finalize the iterator and deallocate any allocated memory.

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:
objectthe object to insert
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.

- (void) dealloc

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:
cnrthe container into which to insert items
itorthe 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:
objectthe 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 Sat Feb 15 2014 07:45:34, © 2004-2007 Will Mason