Go to the previous, next section.
#include <nihcl/SeqCltn.h>
Class
SeqCltn
(Sequenceable Collection) is an abstract class that defines general functions for derived classes such as
LinkedList
,
OrderedCltn
, and
Stack
, whose elements are ordered and accessible by means of an integer index.
virtual void atAllPut(Object&
ob) = 0
SeqCltn
with pointers to the object
ob.
@item{virtual void replaceFrom(int
start, int
stop, const SeqCltn&
replacement,} @itemx{int
startAt
= 0) = 0} Replaces the sequence of object pointers in this
SeqCltn
beginning at index
start
through index
stop
with object pointers from the
SeqCltn
replacement
starting at index
startAt.
virtual unsigned hash() const
Set
can use as a hash table probe. Class
SeqCltn
implements
hash()
by exclusive ORing the results of applying
hash()
to all objects in the
SeqCltn
.
virtual int indexOf(const Object&
ob) const
SeqCltn
that is
isEqual()
to
ob. Returns -1 if no equal object is found.
virtual int indexOfSubCollection(const SeqCltn&
cltn, int
start
= 0) const = 0
SeqCltn
of the sequence of objects that is
isEqual
to
cltn. The search for an equal sequence begins at offset
start
in this
SeqCltn
. Returns -1 if no equal sequence of objects is found.
virtual unsigned occurrencesOf(const Object&
ob) const
SeqCltn
that are
isEqual()
to
ob.
virtual int compare(const Object&
a) const
SeqCltn
; if not, an
NIHCL_BADARGCL
exception is raised. Does a lexical comparison of this
SeqCltn
and the argument object
a
and returns a negative result if this
SeqCltn
is less than
a, zero if they are equal, and a positive result if this
SeqCltn
is greater than
a. The
compare()
function compares the individual objects in the sequenced collections by applying
compare()
to them.
virtual bool isEqual(const Object&
ob) const
YES
if
ob
is a kind of
SeqCltn
that is the same size as this
SeqCltn
, and all corresponding objects are equal, as determined by application of
isEqual()
.
virtual Object* first() const
SeqCltn
, i.e., the object at index 0.
virtual Object* last() const
SeqCltn
, i.e, the object at index
size()
-1.
virtual Object* doNext(Iterator&
pos) const
SeqCltn
, or 0 if no more objects remain. The
Iterator
argument
pos
maintains the state of the iteration for a container so that multiple iterations may be active concurrently for the same container.
virtual const Class* species() const
SeqCltn
.
void indexRangeErr() const
NIHCL_INDEXRANGE
exception.
NIHCL_RDABSTCLASS
,
NIHCL_INDEXRANGE
Go to the previous, next section.