ObjectiveLib  1.0.0
Public Member Functions | Static Public Member Functions
OLHashMultiSet Class Reference

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:
firstthe first in the range of elements to insert
lastone 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:
rightthe 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:
objectthe 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:
firstthe first in the range of objects to insert
lastone 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:
objectthe 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 Sat Feb 15 2014 07:45:34, © 2004-2007 Will Mason