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

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

#import <ObjectiveLib/Set.h>

Inheritance diagram for OLMultiSet:
Inheritance graph
[legend]

List of all members.

Public Member Functions

(id) - insert:
 Insert an object into the set.
(OLAssociativeIterator *) - insertAt:value:
 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) + multiSet
 Create and return a new set.
(id) + multiSetFrom:to:
 Create and return a new set.
(id) + multiSetWithCompare:
 Create and return a new set.
(id) + multiSetWithOLSet:
 Create and return a new set.

Detailed Description

A set that allows multiple instances of objects.

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

See also:
OLSet, OLAssociativeIterator

Member Function Documentation

- (id) insert: (id)  object

Insert an object into the set.

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

Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
objectthe element to insert
Returns:
an instance of OLAssociativeIterator pointing to the newly inserted object

Reimplemented from OLSet.

- (OLAssociativeIterator*) insertAt: (OLAssociativeIterator *)  where
value: (id)  object 

Insert an object into the set.

The object is inserted and the position indicated by where is used as a hint about where in the set the object should be placed. There is no guarantee that the object will ultimately placed anywhere close to where. Note that the insertion may fail if the object is already in the set. An iterator is returned that points to object.

Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
wherea hint as to where in the set the object should be located
objectthe object to insert
Returns:
the iterator indicating where object is now located in the set

Reimplemented from OLSet.

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

Parameters:
firstthe first in the range of objects to insert
lastone position beyond the last in the range of objects to insert

Reimplemented from OLSet.

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

+ (id) multiSet

Create and return a new set.

An instance of OLLess is used to compare items for sorting.

Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Returns:
a new set
+ (id) multiSetFrom: (OLForwardIterator *)  first
to: (OLForwardIterator *)  last 

Create and return a new set.

The set is initialized with the contents of the range [first, last). An instance of OLLess is used to compare items for sorting.

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 set

Create and return a new set.

The set is empty and the comparison function comp is used to sort keys.

Note:
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
compthe comparison function used to sort keys
Returns:
a new set
+ (id) multiSetWithOLSet: (OLSet *)  right

Create and return a new set.

The set is initialized with the contents of right.

Note:
The argument right may be an instance of OLSet or OLMultiSet.
If OpenStep is present the returned object will be autoreleased before being returned.
Parameters:
rightthe set to copy
Returns:
a new set

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

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