### IASequentialCollection

  Because sequential collection is an abstract class, it cannot be used to create any objects. The sequential collection inherits from ordered collection and defines the interfaces for the properties of ordered elements.

### IASequentialCollection - Member Functions and Data by Group

### Constructors & Destructor

Construct and destruct objects of this class.

~IASequentialCollection

      public:
      ~IASequentialCollection()

  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

IASequentialCollection
  Construct or destruct a collection.

  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

  Overload 1

      public:
      IASequentialCollection(INotifier&)

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

Supported Platforms

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

  Overload 2

      protected:
      IASequentialCollection( IASequentialCollection < Element > const& )

  Copy constructor, which is hidden.

Supported Platforms

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

  Overload 3

      protected:
      IASequentialCollection()

  The default constructor, which is hidden.

Supported Platforms

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

### Add Elements

These methods add elements to the collection.

addAsFirst
  Adds the element to the collection as the first element in sequential order. Sets the cursor to the added element.

  Preconditions

  - The cursor must belong to the collection.
  - If the collection is bounded, (numberOfElements() < maxNumberOfElements()).

  Side Effects

  All cursors of this collection, except the given cursor, become undefined.

  Exceptions

  - ICursorInvalidException
  - IOutOfMemory
  - IFullException, if the collection is bounded

  Overload 1

      public:
      virtual void addAsFirst(Element const&, ICursor&)

Supported Platforms

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

  Overload 2

      public:
      virtual void addAsFirst(Element const&)

Supported Platforms

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

addAsLast
  Adds the element to the collection as the last element in sequential order. Sets the cursor to the added element.

  Preconditions

  - The cursor must belong to the collection.
  - If the collection is bounded, (numberOfElements() < maxNumberOfElements()).

  Side Effects

  All cursors of this collection, except the given cursor, become undefined.

  Exceptions

  - ICursorInvalidException
  - IOutOfMemory
  - IFullException, if the collection is bounded

  Overload 1

      public:
      virtual void addAsLast(Element const&, ICursor&)

Supported Platforms

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

  Overload 2

      public:
      virtual void addAsLast(Element const&)

Supported Platforms

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

addAsNext

      public:
      virtual void addAsNext(Element const&, ICursor&)

  Adds the element to the collection as the element following element pointed to by the cursor. Sets the cursor to the added element.

  Preconditions

  - The cursor must belong to the collection and must point to an element of the collection.
  - If the collection is bounded, (numberOfElements() < maxNumberOfElements()).

  Side Effects

  All cursors of this collection, except the given cursor, become undefined.

  Exceptions

  - IOutOfMemory
  - ICursorInvalidException
  - IFullException, if the collection is bounded

Supported Platforms

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

addAsPrevious

      public:
      virtual void addAsPrevious(Element const&, ICursor&)

  Adds the element to the collection as the element preceding the element pointed to by the cursor. Sets the cursor to the added element.

  Preconditions

  - The cursor must belong to the collection and must point to an element of the collection.
  - If the collection is bounded, (numberOfElements() < maxNumberOfElements()).

  Side Effects

  All cursors of this collection, except the given cursor, become undefined.

  Exceptions

  - IOutOfMemory
  - ICursorInvalidException
  - IFullException, if the collection is bounded

Supported Platforms

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

addAtPosition
  Adds the element at the given position to the collection, and sets the cursor to the added element. If an element exists at the given position, the new element is added as the element preceding the existing element.

  Preconditions

  - The cursor must belong to the collection.
  - (1 <= position <= numberOfElements + 1).
  - If the collection is bounded, (numberOfElements() < maxNumberOfElements()).

  Side Effects

  All cursors of this collection, except the given cursor, become undefined.

  Exceptions

  - IOutOfMemory
  - ICursorInvalidException
  - IPositionInvalidException
  - IFullException, if the collection is bounded

  Overload 1

      public:
      virtual void addAtPosition(IPosition, Element const&)

Supported Platforms

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

  Overload 2

      public:
      virtual void
        addAtPosition( IPosition,
                       Element const&,
                       ICursor& )

Supported Platforms

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

### Element Access

These methods provide access to specific elements of the collection.

any

  Returns a reference to an arbitrary element of the collection.

  Precondition

  The collection must not be empty.

  Exception

  IEmptyException

  Overload 1

      public:
      Element& any()

Supported Platforms

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

  Overload 2

      public:
      Element const& any() const

Supported Platforms

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

elementAtPosition

  Returns a reference to the element at the given position in the collection.

  Position 1 specifies the first element.

  Position must be a valid position in the collection; that is, (1 <= position <= numberOfElements()).

  Precondition

  (1 <= position <= numberOfElements()).

  Exception

  IPositionInvalidException

  Overload 1

      public:
      Element& elementAtPosition(IPosition)

Supported Platforms

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

  Overload 2

      public:
      Element const& elementAtPosition(IPosition) const

Supported Platforms

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

first

  Returns a reference to the first element of the collection.

  Precondition

  The collection must not be empty.

  Exception

  IEmptyException

  Overload 1

      public:
      Element& first()

Supported Platforms

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

  Overload 2

      public:
      Element const& first() const

Supported Platforms

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

last

  Returns a reference to the last element of the collection.

  Precondition

  The collection must not be empty.

  Exception

  IEmptyException

  Overload 1

      public:
      Element& last()

Supported Platforms

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

  Overload 2

      public:
      Element const& last() const

Supported Platforms

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

### Element Ordering

These methods control ordering of the elements.

reverse

      public:
      virtual void reverse()

  This function reverses the sequence of elements in a collection. It is valid for all sequential collections:
  - Sequence
  - Equality Sequence

Supported Platforms

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

sort

      public:
      virtual void
        sort( long ( * comparisonFunction ) ( Element const & ,
              Element const & ) )

  Sorts the collection so that the elements occur in ascending order. The relation of two elements is defined by the comparisonFunction, which you provide.

  Note: The comparisonFunction must deliver a result according to the following rules:

  >0
    if (element1 > element2)
  0
    if (element1 == element2)
  <0
    if (element1 < element2)

  Side Effects

  All cursors of this collection become undefined.

Supported Platforms

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

### IASequentialCollection - Inherited Member Functions and Data

#### Inherited Public Functions

  IACollection

  -     virtual ~IACollection()

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

  -     virtual bool add(Element const&)

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

  -     void adoptStreamer(IACollectionStreamer*)

  -     bool allElementsDo(IConstantApplicator < Element >&) const

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

  -     bool allElementsDo(IApplicator < Element >&)

  -     bool
          allElementsDo( bool ( * applicatorFunction ) ( Element const&,
                         void * ) , void* additionalArgument = 0 ) 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( 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

  IAOrderedCollection

  -     ~IAOrderedCollection()

  -     Element const& firstElement() const

  -     IAOrderedCollection(INotifier&)

  -     bool isFirst(ICursor const&) const

  -     bool isFirstAt(ICursor const&) const

  -     bool isLast(ICursor const&) const

  -     bool isLastAt(ICursor const&) const

  -     Element const& lastElement() const

  -     IPosition position(ICursor const&) const

  -     IPosition positionAt(ICursor const&) const

  -     virtual void removeAtPosition(IPosition)

  -     virtual void removeFirst()

  -     virtual void removeLast()

  -     bool setToLast(ICursor&) const

  -     void setToPosition(IPosition, ICursor&) const

  -     bool setToPrevious(ICursor&) const

#### Inherited Public Data

  - None

#### Inherited Protected Functions

  IACollectionBase

  -     ~IACollectionBase()

  -     static ICursorImpl& CrsrImplOf(ICursor& cursor)

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

  -     IACollectionBase()

  -     IACollectionBase(IACollectionBase const&)

  -     static ICursor* InterfaceFor(ICursorImpl* cursor)

  IACollection

  -     IACollection(IACollection < Element > const&)

  -     IACollection()

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

  IAOrderedCollection

  -     IAOrderedCollection()

  -     IAOrderedCollection(IAOrderedCollection < Element > const&)

#### Inherited Protected Data

  - None