Because equality collection is an abstract class, it cannot be used to create any objects. The equality collection defines the interfaces for the property of element equality.
You can construct and destruct objects of this class.
![]() |
public:
~IAEqualityCollection()
Removes all elements from the collection. Destructors are called for all elements contained in the collection and for elements that have been constructed in advance.
Side Effects
All cursors of the collection become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
IAEqualityCollection(INotifier&)
Use this constructor to create a collection with support for notification.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IAEqualityCollection( IAEqualityCollection < Element > const& )
Constructs a collection from another collection.
Exception
IOutOfMemory
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IAEqualityCollection()
The default constructor. The collection is unbounded and is initially empty. If the estimated maximum is exceeded, the collection is automatically enlarged.
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to execute miscellaneous operations.
![]() |
public:
bool contains(Element const&) const
Returns true if the collection contains an element equal to the given element.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool containsAllFrom(IACollection < Element > const&) const
Returns true if all the elements of the given collection are contained in the collection. The definition of containment is described in IAEqualityCollection::contains
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool locate(Element const&, ICursor&) const
Locates an element in the collection that is equal to the given element. Sets the cursor to point to the element in the collection, or invalidates the cursor if no such element exists.
If the collection contains several such elements, the first element in iteration order is located.
Precondition
The cursor must belong to the collection.
Return Value
Returns true if an element was found.
Exceptions
ICursorInvalidException
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool locateNext(Element const&, ICursor&) const
Locates the next element in iteration order
in the collection that is equal to the given
element, starting at the element next to the one
pointed to by the given cursor.
Sets the cursor to point to the element in the collection.
The cursor is invalidated if the end of the collection is reached and
no more occurrences of the given
element are left to be visited.
Precondition
The cursor must belong to the collection and
must point to an element of the collection.
Return Value
Returns true if an element was found.
Exception
ICursorInvalidException
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
Locates an element in the collection that is equal to the given
element. (See IAEqualityCollection::locate for details on locate().)
If no such element is found, locateOrAdd adds the
element as described in IACollection::add.
The cursor is set to the located or added element.
Preconditions
Side Effects
If the element was added, all cursors of this collection,
except the given cursor, become undefined.
Return Value
Returns true if the element was located. Returns
false if the element could not be located but had to be added.
Exceptions
Note:
public:
virtual bool locateOrAdd(Element const&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
public:
virtual bool locateOrAdd(Element const&, ICursor&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
INumber numberOfOccurrences(Element const&) const
Returns the number of occurrences of the given element in the collection.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual bool remove(Element const&)
Removes an element in the collection that is equal to the given element. If no such element exists, the collection remains unchanged. In collections with nonunique elements, an arbitrary occurrence of the given element will be removed. Element destructors are called as described in IACollection::removeAt.
Side Effects
If an element was removed, all cursors of this collection become undefined. become undefined.
Return Value
Returns true if an element was removed.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual INumber removeAllOccurrences(Element const&)
Removes all elements from the collection that are equal to the given element, and returns the number of elements removed. Element destructors are called as described in IACollection::removeAt.
Side Effects
If any elements were removed, all cursors of this collection become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~IACollection()
virtual bool add(Element const&, ICursor&)
virtual bool add(Element const&)
virtual void addAllFrom(IACollection < Element > const&)
void adoptStreamer(IACollectionStreamer*)
bool allElementsDo( bool ( * applicatorFunction ) ( Element const&, void * ) , void* additionalArgument = 0 ) const
bool allElementsDo( bool ( * applicatorFunction ) ( Element&, void * ) , void* additionalArgument = 0 )
bool allElementsDo(IConstantApplicator < Element >&) const
bool allElementsDo(IApplicator < Element >&)
Element const& any() const
Element const& anyElement() const
virtual void copy(IACollection < Element > const&)
INotifier& disableNotification()
Element& elementAt(ICursor const&)
Element const& elementAt(ICursor const&) const
INotifier& enableNotification(bool = true)
IACollection(INotifier&)
bool isBounded() const
bool isConsistent() const
bool isEmpty() const
bool isEnabledForNotification() const
bool isFull() const
INumber maxNumberOfElements() const
virtual ICursor* newCursor() const
ICursor* newMngCursor() const
INotifier& notifier()
INotifier const& notifier() const
INotifier& notifyObservers(INotificationEvent const&)
INumber numberOfElements() const
virtual void operator <<=(IDataStream&)
virtual void operator >>=(IDataStream&)
operator INotifier &() const
virtual INumber removeAll()
virtual INumber removeAll( bool ( * predicateFunction ) ( Element const&, void * ) , void* additionalArgument = 0 )
virtual void removeAt(ICursor&)
virtual void replaceAt(ICursor const&, Element const&)
bool setToFirst(ICursor&) const
bool setToNext(ICursor&) const
IACollection()
IACollection(IACollection < Element > const&)
static Implementation& ImplOf( IACollection < Element > const& )