### IAOrderedCollection

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

### IAOrderedCollection - Member Functions and Data by Group

### Constructors & Destructor

Construct and destruct objects of this class.

~IAOrderedCollection

      public:
      ~IAOrderedCollection()

  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

IAOrderedCollection
  Construct and destruct objects of this class.
  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:
      IAOrderedCollection(INotifier&)

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

Supported Platforms

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

  Overload 2

      protected:
      IAOrderedCollection(IAOrderedCollection < Element > const&)

  Copy constructs a collection.

Supported Platforms

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

  Overload 3

      protected:
      IAOrderedCollection()

  The default constructor.

Supported Platforms

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

### Cursor Support

Set cursors to point at particular elements of the collection.

setToLast

      public:
      bool setToLast(ICursor&) const

  Sets the cursor to the last element of the collection in iteration order. If the collection is empty (if no last element exists), the given cursor is no longer valid.

  Precondition

  The cursor must belong to the collection.

  Return Value

  Returns true if the collection is not empty.

  Exceptions

  ICursorInvalidException

Supported Platforms

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

setToPosition

      public:
      void setToPosition(IPosition, ICursor&) const

  Sets the cursor to the element at the given position. Position 1 specifies the first element.

  Precondition

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

  Exceptions

  - ICursorInvalidException
  - IPositionInvalidException

Supported Platforms

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

setToPrevious

      public:
      bool setToPrevious(ICursor&) const

  Sets the cursor to the previous element in iteration order, 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 a previous element exists.

  Exception

  ICursorInvalidException

Supported Platforms

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

### Element Access

Access particular elments in the collection.

elementAtPosition

      public:
      Element const& elementAtPosition(IPosition) const

  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

Supported Platforms

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

first

      public:
      Element const& first() const

  Provides the same functionality as firstElement().

Supported Platforms

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

firstElement

      public:
      Element const& firstElement() const

  Returns a reference to the first element of the collection.

  Precondition

  The collection must not be empty.

  Exception

  IEmptyException

Supported Platforms

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

last

      public:
      Element const& last() const

  Provides the same functionality as lastElement().

Supported Platforms

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

lastElement

      public:
      Element const& lastElement() const

  Returns a reference to the last element of the collection.

  Precondition

  The collection must not be empty.

  Exception

  IEmptyException

Supported Platforms

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

### Element Position Testing

See if a cursor is pointing at an element at a particular position in the collection.

isFirst

      public:
      bool isFirst(ICursor const&) const

  Provides the same functionality as isFirstAt().

Supported Platforms

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

isFirstAt

      public:
      bool isFirstAt(ICursor const&) const

  Returns true if the given cursor points to the first element of the collection.

  Preconditions

  The cursor must belong to the collection and must point to an element of the collection.

  Exception

  ICursorInvalidException

Supported Platforms

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

isLast

      public:
      bool isLast(ICursor const&) const

  Provides the same functionality as isLastAt().

Supported Platforms

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

isLastAt

      public:
      bool isLastAt(ICursor const&) const

  Returns true if the given cursor points to the last element of the collection.

  Preconditions

  The cursor must belong to the collection and must point to an element of the collection.

  Exception

  ICursorInvalidException

Supported Platforms

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

position

      public:
      IPosition position(ICursor const&) const

  Provides the same functionality as positionAt().

Supported Platforms

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

positionAt

      public:
      IPosition positionAt(ICursor const&) const

  Determines the position of the current element. position 1 specifies the position of the first element.

  Preconditions The cursor must belong to the collection, and the cursor must point to an element of the collection.

  Exceptions ICursorInvalidException

Supported Platforms

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

### Remove Elements

Remove elements from the collection.

removeAtPosition

      public:
      virtual void removeAtPosition(IPosition)

  Removes the element from the collection that is at the given position. Element destructors are called as described in IACollection::removeAt.

  The first element of the collection has position 1.

  Precondition

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

  Side Effects

  All cursors of this collection become undefined.

  Exception

  IPositionInvalidException

Supported Platforms

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

removeFirst

      public:
      virtual void removeFirst()

  Removes the first element from the collection. Element destructors are called as described in IACollection::removeAt.

  Precondition

  The collection must not be empty.

  Side Effects

  All cursors of this collection become undefined.

  Exception

  IEmptyException

Supported Platforms

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

removeLast

      public:
      virtual void removeLast()

  Removes the last element from the collection. Element destructors are called as described in IACollection::removeAt.

  Precondition

  The collection must not be empty.

  Side Effects

  All cursors of this collection become undefined.

  Exception

  IEmptyException

Supported Platforms

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

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

  -     bool allElementsDo(IConstantApplicator < Element >&) const

  -     bool allElementsDo(IApplicator < Element >&)

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

  -     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& 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

#### 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& )

#### Inherited Protected Data

  - None