The keys of the elements are not unique. You can add an element whether or not there is already an element in the collection with the same key.
Construct and destruct IARelation objects.
![]() |
public:
~IARelation()
Side Effects
All cursors of the collection become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
Exception
IOutOfMemory
Note:
public:
IARelation(INotifier&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IARelation(IARelation < Element, Key > const&)
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IARelation()
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Add elements to this collection.
![]() |
public:
virtual void addDifference( IARelation < Element, Key > const&, IARelation < Element, Key > const& )
For a definition of the difference between two collections, see IABag::differenceWith.
Preconditions
Because the elements are added one by one, the following preconditions are tested for each individual addition.
Side Effects
If any elements were added, all cursors of this collection become undefined.
Exceptions
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual void addIntersection( IARelation < Element, Key > const&, IARelation < Element, Key > const& )
Creates the intersection of the two given collections, and adds this intersection to the collection. The contents of the added elements, not the pointers to those elements, are copied.
For a definition of the intersection of two collections, see IABag::intersectionWith.
Preconditions
Because the elements are added one by one, the following preconditions are tested for each individual addition.
Side Effects
If any elements were added, all cursors of this collection become undefined.
Exceptions
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual void addUnion( IARelation < Element, Key > const&, IARelation < Element, Key > const& )
For a definition of the union of two collections, see IABag::unionWith.
Preconditions
Because the elements are added one by one, the following preconditions are tested for each individual addition.
Side Effects
If any elements were added, all cursors of this collection become undefined.
Exceptions
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Compare IARelation objects.
![]() |
public:
bool operator !=(IARelation < Element, Key > const&) const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
bool operator ==(IARelation < Element, Key > const&) const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Perform difference, intersection, and union operations on this IARelation object and another one, leaving the results in this object.
![]() |
public:
virtual void differenceWith( IARelation < Element, Key > const& )
The following rule applies for bags with duplicate elements: If bag P contains the element X m times and bag Q contains the element X n times, the difference of P and Q contains the element X m-n times if m > n, and zero times if m<=n.
Side Effects
If any elements were removed, all cursors of this collection become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual void intersectionWith( IARelation < Element, Key > const& )
The following rule applies for bags with duplicate elements: If bag P contains the element X m times and bag Q contains the element X n times, the intersection of P and Q contains the element X MIN(m,n): times.
Side Effects
If any elements were removed, all cursors of this collection become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
![]() |
public:
virtual void unionWith(IARelation < Element, Key > const&)
The following rule applies for bags with duplicate elements: If bag P contains the element X m times and bag Q contains the element X n times, the union of P and Q contains the element X m+n times.
Preconditions
Because the elements from the given collection are added to the collection one by one, the following preconditions are tested for each individual add operation :
Side Effects
If any elements were added to the collection, all cursors of this collection become undefined.
Exceptions
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Remove elements from the collection.
![]() |
protected:
INumber removeAllOccurrences(Element const&)
Side Effects
If any elements were removed, all cursors of this collection become undefined.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Find elements in the collection that match a particular value.
![]() |
protected:
bool locateNext(Element const&, ICursor&) const
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 |
![]() |
protected:
INumber numberOfOccurrences(Element const&) const
Windows | OS/2 | AIX |
Yes | Yes | Yes |
virtual ~IACollection()
virtual bool add(Element const&)
virtual bool add(Element const&, ICursor&)
virtual void addAllFrom(IACollection < Element > const&)
void adoptStreamer(IACollectionStreamer*)
bool allElementsDo( bool ( * applicatorFunction ) ( Element&, void * ) , void* additionalArgument = 0 )
bool allElementsDo(IConstantApplicator < Element >&) const
bool allElementsDo(IApplicator < Element >&)
bool allElementsDo( bool ( * applicatorFunction ) ( Element const&, void * ) , void* additionalArgument = 0 ) const
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 const& notifier() const
INotifier& notifier()
INotifier& notifyObservers(INotificationEvent const&)
INumber numberOfElements() const
virtual void operator <<=(IDataStream&)
virtual void operator >>=(IDataStream&)
operator INotifier &() const
virtual INumber removeAll( bool ( * predicateFunction ) ( Element const&, void * ) , void* additionalArgument = 0 )
virtual INumber removeAll()
virtual void removeAt(ICursor&)
virtual void replaceAt(ICursor const&, Element const&)
bool setToFirst(ICursor&) const
bool setToNext(ICursor&) const
~IAEqualityKeyCollection()
IAEqualityKeyCollection(INotifier&)
~IAKeyCollection()
virtual bool addOrReplaceElementWithKey( Element const&, ICursor& )
virtual bool addOrReplaceElementWithKey(Element const&)
bool containsAllKeysFrom( IACollection < Element > const& ) const
bool containsElementWithKey(Key const&) const
Element& elementWithKey(Key const&)
Element const& elementWithKey(Key const&) const
IAKeyCollection(INotifier&)
Key const& key(Element const&) const
bool locateElementWithKey(Key const&, ICursor&) const
bool locateNextElementWithKey(Key const&, ICursor&) const
virtual bool locateOrAddElementWithKey(Element const&)
virtual bool locateOrAddElementWithKey( Element const&, ICursor& )
INumber numberOfDifferentKeys() const
INumber numberOfElementsWithKey(Key const&) const
virtual INumber removeAllElementsWithKey(Key const&)
virtual bool removeElementWithKey(Key const&)
virtual bool replaceElementWithKey(Element const&)
virtual bool replaceElementWithKey( Element const&, ICursor& )
bool setToNextWithDifferentKey(ICursor&) const
IACollection(IACollection < Element > const&)
IACollection()
static Implementation& ImplOf( IACollection < Element > const& )
IAEqualityKeyCollection()
IAEqualityKeyCollection( IAEqualityKeyCollection < Element, Key > const& )
IAKeyCollection(IAKeyCollection < Element, Key > const&)
IAKeyCollection()