A 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.
The type and value of the elements are irrelevant, and have no effect on the behavior of the collection. Elements can be added and deleted from any position in the collection. Elements can be retrieved or replaced. A sequence does not support element equality or a key. If you require element equality for a sequence, you can use an equality sequence.
You can construct and destruct objects of this class.
![]() |
public:
~IASequence()
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 |
![]() |
You can construct and destruct objects of this class.
public:
IASequence(INotifier&)
Use this constructor to create a collection with support for notification.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IASequence(IASequence < Element > const&)
Constructs a collection.
The collection is unbounded and is initially empty.
Exception
IOutOfMemory
Note:
Windows | OS/2 | AIX |
Yes | Yes | Yes |
protected:
IASequence()
The default constructor.
Windows | OS/2 | AIX |
Yes | Yes | Yes |
Use these members to compare two elements in a given sequence.
![]() |
public:
long compare( IASequence < 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.
Return Value
Returns the result of the collection comparison.
Note:
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(IConstantApplicator < Element >&) const
bool allElementsDo(IApplicator < Element >&)
bool allElementsDo( bool ( * applicatorFunction ) ( Element&, void * ) , void* additionalArgument = 0 )
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()
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
~IASequentialCollection()
virtual void addAsFirst(Element const&)
virtual void addAsFirst(Element const&, ICursor&)
virtual void addAsLast(Element const&, ICursor&)
virtual void addAsLast(Element const&)
virtual void addAsNext(Element const&, ICursor&)
virtual void addAsPrevious(Element const&, ICursor&)
virtual void addAtPosition( IPosition, Element const&, ICursor& )
virtual void addAtPosition(IPosition, Element const&)
Element& any()
Element const& any() const
Element const& elementAtPosition(IPosition) const
Element& elementAtPosition(IPosition)
Element& first()
Element const& first() const
IASequentialCollection(INotifier&)
Element const& last() const
Element& last()
virtual void reverse()
virtual void sort( long ( * comparisonFunction ) ( Element const & , Element const & ) )
IACollection(IACollection < Element > const&)
IACollection()
static Implementation& ImplOf( IACollection < Element > const& )
IAOrderedCollection(IAOrderedCollection < Element > const&)
IAOrderedCollection()
IASequentialCollection()
IASequentialCollection( IASequentialCollection < Element > const& )