#include <collection.h>
Public Member Functions | |
Collection (void) | |
virtual bool | isEmpty (void) const =0 |
virtual unsigned int | size (void) const =0 |
virtual AbstractIterator< T > * | iteratorPtr (void) const =0 |
virtual void | purge (void)=0 |
virtual T & | first (void)=0 throw (EmptyCollectionException) |
virtual const T & | first (void) const =0 throw (EmptyCollectionException) |
virtual T & | last (void)=0 throw (EmptyCollectionException) |
virtual const T & | last (void) const =0 throw (EmptyCollectionException) |
seal::Collection< T >::Collection | ( | void | ) | [inline] |
Default constructor. Does nothing.
virtual bool seal::Collection< T >::isEmpty | ( | void | ) | const [pure virtual] |
In a derived collection class, this function will return true
if the collection is empty. That is, it returns true
when if there are no elements in the collection. It returns flase
if there exists atleast one element in the collection.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.
virtual unsigned int seal::Collection< T >::size | ( | void | ) | const [pure virtual] |
In a derived collection class, this function will return the size of the collection. Typically, size of collection is equal to the number of elements in the collection.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.
virtual AbstractIterator<T>* seal::Collection< T >::iteratorPtr | ( | void | ) | const [pure virtual] |
In a derived collection class, this function will return a pointer to the iterator of that collection class. The users of the collection should delete the iterator returned by this function. The implementers of concrete collection classes should keep in mind that the class should not be responsible for deleting the iterator object returned by this function. The clients of this function should be responsible to delete the returned iterator object.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.
virtual void seal::Collection< T >::purge | ( | void | ) | [pure virtual] |
In a derived collection class, a call to this function will remove all the elements from the collection. Typically, size of the collection will become zero after a call to this function.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.
virtual T& seal::Collection< T >::first | ( | void | ) | throw (EmptyCollectionException) [pure virtual] |
Returns a reference to the first element in the collection. Throws an seal::EmptyCollectionException
if the collection is empty.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.
virtual const T& seal::Collection< T >::first | ( | void | ) | const throw (EmptyCollectionException) [pure virtual] |
Returns a constant reference to the first element in the collection. Throws an seal::EmptyCollectionException
if the collection is empty.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.
virtual T& seal::Collection< T >::last | ( | void | ) | throw (EmptyCollectionException) [pure virtual] |
Returns a reference to the last element in the collection. Throws an seal::EmptyCollectionException
if the collection is empty.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.
virtual const T& seal::Collection< T >::last | ( | void | ) | const throw (EmptyCollectionException) [pure virtual] |
Returns a constant reference to the last element in the collection. Throws an seal::EmptyCollectionException
if the collection is empty.
Implemented in seal::Array1D< T >, seal::CompleteBinaryTree< T >, seal::LinkedList< T >, seal::Map< IndexType, DataType >, seal::PriorityQueue< PrtType, DataType >, seal::Vector< T >, seal::Array1D< seal::Cell< DataType > >, seal::Array1D< seal::QuadByte >, seal::LinkedList< seal::BinTreeNode< T > * >, seal::Vector< seal::Vector >, and seal::Vector< seal::Array1D< T > >.