NAME
OTC_ListI -
Base functionality for a list.
SYNOPSIS
#include <OTC/collctn/listi.hh>
class OTC_ListI
{
public:
~OTC_ListI();
OTC_ListI();
OTC_ListI(OTC_ListI const& theList);
inline OTC_LinkList* list() const;
inline OTC_AVLTree* tree() const;
inline u_int population() const;
inline OTC_Boolean isEmpty() const;
inline void removeAll();
inline void removeFirst();
inline void removeLast();
void removeItem(int theIndex);
void removeRange(int theStart, u_int theLength);
inline void removeRange(OTC_Range theRange);
OTC_Link* first() const;
OTC_Link* last() const;
OTC_Link* item(int theIndex) const;
inline void addFirst(OTC_Link* theLink);
inline void addLast(OTC_Link* theLink);
void addBeforeItem(OTC_Link* theLink, int theIndex);
};
CLASS TYPE
Abstract
DESCRIPTION
The OTC_ListI class encapsulates the base functionality
for implementing OTC_List.
INITIALISATION
OTC_ListI();
OTC_ListI(OTC_ListI const& theList);
Creates a list which is an alias for
theList. Ie., each shares and access
the same implementation.
QUERY
inline OTC_LinkList* list() const;
Returns the underlying list.
inline OTC_AVLTree* tree() const;
Returns the underlying index tree.
inline u_int population() const;
Returns the number of links in the
list.
inline OTC_Boolean isEmpty() const;
Returns OTCLIB_TRUE if the the list
is empty.
REMOVAL
inline void removeAll();
Removes all links from the list.
inline void removeFirst();
Removes the first link in the list. If
the list is empty, an exception is
raised.
inline void removeLast();
Removes the last link in the list. If
the list is empty, an exception is
raised.
void removeItem(int theIndex);
Removes the link at location theIndex.
Raises an exception if there is no link at
location theIndex.
void removeRange(int theStart, u_int theLength);
Removes theLength links starting at
location theStart. Raises an exception
of the index or link are invalid.
inline void removeRange(OTC_Range theRange);
Removes theLength links starting at
location theStart. Raises an exception
of the index or link are invalid.
RETRIEVAL
OTC_Link* first() const;
Returns the first link in the list.
Raises an exception if the list is empty.
OTC_Link* last() const;
Returns the last link in the list. Raises
an exception if the list is empty.
OTC_Link* item(int theIndex) const;
Returns the link an location theIndex.
Raises an exception if theIndex is
invalid.
ADDITION
inline void addFirst(OTC_Link* theLink);
Adds theLink at the start of the
the list.
inline void addLast(OTC_Link* theLink);
Adds theLink at the end of the
the list.
void addBeforeItem(OTC_Link* theLink, int theIndex);
Adds theLink in the list at a location
theIndex.
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED