OLHashMultiSet Class Reference
[Containers]

A hash set that allows multiple instances of objects. More...

#import <ObjectiveLib/HashSet.h>

Inheritance diagram for OLHashMultiSet:

Inheritance graph
[legend]
List of all members.

Public Member Functions

(id) - insert:
 Insert an object into the set.
(void) - insertFrom:to:
 Insert a range of objects into the set.
(BOOL) - isEqual:
 Test whether another set is equal to this one.

Static Public Member Functions

(id) + hashMultiSet
 Create and return a new hash set.
(id) + hashMultiSetFrom:to:
 Create and return a new hash set.
(id) + hashMultiSetWithHashSet:
 Create and return a new hash set.

Detailed Description

A hash set that allows multiple instances of objects.

Hash multiset is identical to hash set expect that as many instances of a given object may be inserted as desired.

See also:
OLHashSet, OLHashIterator


Member Function Documentation

+ (id) hashMultiSet  

Create and return a new hash set.

Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Returns:
a new hash set

+ (id) hashMultiSetFrom: (OLForwardIterator *)  first
to: (OLForwardIterator *)  last 

Create and return a new hash set.

The hash set is initialized with the contents of the range [first, last).

Precondition:
All objects in the range [first, last) must respond to the message hash.
Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
first the first in the range of elements to insert
last one beyond the last in the range of elements to insert
Returns:
a new hash set

+ (id) hashMultiSetWithHashSet: (OLHashSet *)  right  

Create and return a new hash set.

The hash set is initialized with the contents of right.

Note:
If OpenStep is present the returned object will be autoreleased before being returned.

The argument right may be an instance of OLHashSet or of OLHashMultiSet.

Parameters:
right the hash set to copy
Returns:
a new hash set

- (id) insert: (id)  object  

Insert an object into the set.

The object is inserted and an instance of OLHashIterator is returned indicating the position of object in the set.

Precondition:
The object to insert must respond to the message hash.
Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
object the element to insert
Returns:
an instance of OLHashIterator pointing to the newly inserted object

Reimplemented from OLHashSet.

- (void) insertFrom: (OLForwardIterator *)  first
to: (OLForwardIterator *)  last 

Insert a range of objects into the set.

An attempt is made to insert all objects in the range [first, last), however there is no guarantee that any of the elements in the range will actually be inserted if they already exist in the set.

Precondition:
All objects in the range [first, last) must respond to the message hash.
Parameters:
first the first in the range of objects to insert
last one position beyond the last in the range of objects to insert

Reimplemented from OLHashSet.

- (BOOL) isEqual: (id)  object  

Test whether another set is equal to this one.

Two sets are considered equal if they contain the same number of objects and the objects are in the same order and each object is equal to the corresponding object in the other set.

Parameters:
object the object to test
Returns:
YES if object is equal to this set

Reimplemented from OLHashSet.


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