### IAEqualitySequence

  An equality sequence is an ordered collection of elements. The elements are arranged so that each collection has a first and a last element, each element except the last has a next element, and each element but the first has a previous element. An equality sequence supports element equality, which gives you the ability, for example, to search for particular elements.

### IAEqualitySequence - Member Functions and Data by Group

### Constructors & Destructor

Use these members to construct and destruct objects of the class.

~IAEqualitySequence

      public:
      ~IAEqualitySequence()

  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.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

IAEqualitySequence

  Overload 1

      public:
      IAEqualitySequence(INotifier&)

  Use this constructor to create a collection with support for notification.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 2

      protected:
      IAEqualitySequence(IAEqualitySequence < Element > const&)

  Constructs a collection. The collection is unbounded and is initially empty.
  Note: The collection constructor does not define whether any elements are constructed when the collection is constructed. For some classes, the element's default constructor may be invoked when the collection's constructor is invoked. This happens if a tabular or a diluted sequence implementation variant is used for a collection. The element's default constructor is used to allocate the required storage and initialize the elements. Therefore, a default constructor must be available for elements in such cases.

  Exception

  IOutOfMemory

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

  Overload 3

      protected:
      IAEqualitySequence()

  This is the default constructor.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Comparison

Use these members as comparison operators.

compare

      public:
      long
        compare( IAEqualitySequence < Element > const&,
                 long ( * comparisonFunction ) ( Element const & ,
                 Element const & ) ) const

  Compares the collection with the given collection. Comparison yields <0 if the collection is less than the given collection, 0 if the collection is equal to the given collection, and >0 if the collection is greater than the given collection. Comparison is defined by the first pair of corresponding elements, in both collections, that are not equal. If such a pair exists, the collection with the greater element is the greater one. Otherwise, the collection with more elements is the greater one.
  Note:

  1. The given comparison function must return a result according to the following rules:
     >0
       if (element1 > element2)
     0
       if (element1 == element2)
     <0
       if (element1 < element2)
  2. For elements of type char*, compare() is not locale-sensitive by default. Because it uses strcmp() and not strcoll(), it compares the binary values representing the characters, and is not based on the LC_COLLATE category of the current locale. Its results are reliable only for code pages and character sets in which the collating sequence matches the sequence of binary representations. If you need a comparison based on the LC_COLLATE cateogory, then you must implement your own compare() function as described in :Using Separate Functions in the Class Library User's Guide.

  Return Value

  Returns the result of the collection comparison.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### Miscellaneous

Use these members to execute miscellaneous tasks.

locateFirst

      public:
      bool locateFirst(Element const&, ICursor&) const

  Locates the first element in iteration order in the collection that is equal to the given element. Sets the cursor to the located element, or invalidates the cursor if no such element exists.

  Precondition

  The cursor must belong to the collection.

  Return Value

  Returns true if an element was found.

  Exception

  ICursorInvalidException

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

locateLast

      public:
      bool locateLast(Element const&, ICursor&) const

  Locates the last element in iteration order in the collection that is equal to the given element. Sets the cursor to the located element, or invalidates the cursor if no such element exists.

  Precondition

  The cursor must belong to the collection.

  Return Value

  Returns true if an element was found.

  Exception

  ICursorInvalidException

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

locatePrevious

      public:
      bool locatePrevious(Element const&, ICursor&) const

  Locates the previous element in iteration order that is equal to the given element, beginning at the element previous to the one specified by the given cursor and moving in reverse iteration order through the elements. Sets the cursor to the located element, or invalidates the cursor if no such element exists.

  Preconditions

  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.

  Exceptions

  ICursorInvalidException

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator !=

      public:
      bool
        operator !=( IAEqualitySequence < Element > const& ) const

  Returns true if the cursor does not point to the same element (of the same collection) as the given cursor.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

operator ==

      public:
      bool
        operator ==( IAEqualitySequence < Element > const& ) const

  Returns true if the cursor points to the same element (of the same collection) as the given cursor.

Supported Platforms

  Windows | OS/2 | AIX
  Yes | Yes | Yes

### IAEqualitySequence - Inherited Member Functions and Data

#### Inherited Public Functions

  IACollection

  -     virtual ~IACollection()

  -     virtual bool add(Element const&)

  -     virtual bool add(Element const&, ICursor&)

  -     virtual void addAllFrom(IACollection < Element > const&)

  -     void adoptStreamer(IACollectionStreamer*)

  -     bool allElementsDo(IApplicator < Element >&)

  -     bool
          allElementsDo( bool ( * applicatorFunction ) ( Element&,
                         void * ) , void* additionalArgument = 0 )

  -     bool
          allElementsDo( bool ( * applicatorFunction ) ( Element const&,
                         void * ) , void* additionalArgument = 0 ) const

  -     bool allElementsDo(IConstantApplicator < Element >&) const

  -     Element const& any() const

  -     Element const& anyElement() const

  -     virtual void copy(IACollection < Element > const&)

  -     INotifier& disableNotification()

  -     Element const& elementAt(ICursor const&) const

  -     Element& elementAt(ICursor 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()

  -     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

  IAEqualityCollection

  -     ~IAEqualityCollection()

  -     bool contains(Element const&) const

  -     bool containsAllFrom(IACollection < Element > const&) const

  -     IAEqualityCollection(INotifier&)

  -     bool locate(Element const&, ICursor&) const

  -     bool locateNext(Element const&, ICursor&) const

  -     virtual bool locateOrAdd(Element const&, ICursor&)

  -     virtual bool locateOrAdd(Element const&)

  -     INumber numberOfOccurrences(Element const&) const

  -     virtual bool remove(Element const&)

  -     virtual INumber removeAllOccurrences(Element const&)

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IACollectionBase

  -     ~IACollectionBase()

  -     static ICursorImpl& CrsrImplOf(ICursor& cursor)

  -     static ICursorImpl const& CrsrImplOf(ICursor const& cursor)

  -     IACollectionBase(IACollectionBase const&)

  -     IACollectionBase()

  -     static ICursor* InterfaceFor(ICursorImpl* cursor)

  IACollection

  -     IACollection()

  -     IACollection(IACollection < Element > const&)

  -     static Implementation&
          ImplOf( IACollection < Element > const& )

  IAEqualityCollection

  -     IAEqualityCollection( IAEqualityCollection < Element > const& )

  -     IAEqualityCollection()

#### Inherited Protected Data

  - None