beecrypt::util::Collection< E > Class Template Reference
[C++ classes mimicking java.util]

#include <Collection.h>

Inheritance diagram for beecrypt::util::Collection< E >:

Inheritance graph
[legend]
Collaboration diagram for beecrypt::util::Collection< E >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Collection ()
virtual bool add (E *e)=0
virtual bool addAll (const Collection< E > &c)=0
virtual void clear ()=0
virtual bool contains (const E *e) const =0
virtual bool containsAll (const Collection< E > &c) const =0
virtual bool equals (const Object *obj) const =0 throw ()
virtual jint hashCode () const =0 throw ()
virtual bool isEmpty () const =0 throw ()
virtual Iterator< E > * iterator ()=0
virtual Iterator< E > * iterator () const =0
virtual bool remove (const E *e)=0
virtual bool removeAll (const Collection< E > &c)=0
virtual bool retainAll (const Collection< E > &c)=0
virtual jint size () const =0 throw ()
virtual array< E * > toArray () const =0


Detailed Description

template<class E>
class beecrypt::util::Collection< E >

Note:
In deviation from the Java API, the add(), contains() and remove() methods take the template parameter class E as parameter rather than Object.
There is a very important reason for this: in Java, even an interface is an Object, but in this API it isn't. Using Object as parameter would mean a great deal of dynamic_cast operations.

From the OO point-of-view it makes much more sense that a collection of E should only accept elements of class E as parameters.

Warning:
If you do not use a parameter that is a subclass of Object (e.g. an interface), then you must guarantee that it has a method which matches Object::equals().

Constructor & Destructor Documentation

template<class E>
virtual beecrypt::util::Collection< E >::~Collection (  )  [inline, virtual]


Member Function Documentation

template<class E>
virtual bool beecrypt::util::Collection< E >::add ( E *  e  )  [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::addAll ( const Collection< E > &  c  )  [pure virtual]

template<class E>
virtual void beecrypt::util::Collection< E >::clear (  )  [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::contains ( const E *  e  )  const [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::containsAll ( const Collection< E > &  c  )  const [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::equals ( const Object obj  )  const throw () [pure virtual]

template<class E>
virtual jint beecrypt::util::Collection< E >::hashCode (  )  const throw () [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::isEmpty (  )  const throw () [pure virtual]

template<class E>
virtual Iterator<E>* beecrypt::util::Collection< E >::iterator (  )  const [pure virtual]

template<class E>
virtual Iterator<E>* beecrypt::util::Collection< E >::iterator (  )  [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::remove ( const E *  e  )  [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::removeAll ( const Collection< E > &  c  )  [pure virtual]

template<class E>
virtual bool beecrypt::util::Collection< E >::retainAll ( const Collection< E > &  c  )  [pure virtual]

template<class E>
virtual jint beecrypt::util::Collection< E >::size (  )  const throw () [pure virtual]

template<class E>
virtual array<E*> beecrypt::util::Collection< E >::toArray (  )  const [pure virtual]


The documentation for this class was generated from the following file:

Generated on Fri Jun 19 13:39:43 2009 for BeeCrypt C++ by  doxygen 1.5.8