Jive reference manual
List of all members | Public Member Functions | Protected Member Functions | Friends
jem::util::WeakHashMap Class Reference

#include <jem/util/WeakHashMap.h>

Inheritance diagram for jem::util::WeakHashMap:
Inheritance graph

Public Member Functions

 WeakHashMap ()
 
virtual void readFrom (io::ObjectInput &in)
 
virtual void writeTo (io::ObjectOutput &out) const
 
virtual Ref< Objectclone () const
 
virtual Ref< MapEnumgetMapEnum () const
 
virtual Ref< Objectget (const Ref< Object > &key) const
 
virtual bool find (Ref< Object > &value, const Ref< Object > &key) const
 
virtual void insert (const Ref< Object > &key, const Ref< Object > &value)
 
virtual void erase (const Ref< Object > &key)
 
virtual void clear ()
 Deletes all objects from this collection. More...
 
virtual void reserve (idx_t count)
 
virtual void trimToSize ()
 Deallocates non-used memory. More...
 
virtual idx_t capacity () const
 Returns the capacity of this collection. More...
 
virtual idx_t size () const
 Returns the number of objects in this collection. More...
 
- Public Member Functions inherited from jem::util::ObjectMap
Ref< MapEnumenumerate () const
 
virtual Ref< EnumeratorgetEnumerator () const
 Returns an enumerator over this collection. More...
 
virtual bool contains (const Ref< Object > &key) const
 
virtual bool add (const Ref< Object > &obj)
 Adds an object to this collection. More...
 
- Public Member Functions inherited from jem::util::ObjectCollection
virtual ClassgetClass () const
 Returns the Class instance representing the runtime class of this object. More...
 
Ref< Enumeratorenumerate () const
 Returns an enumerator over this collection. More...
 
virtual void reserve (int n)
 Pre-allocates data structures for storing additional objects. More...
 
- Public Member Functions inherited from jem::Object
virtual String toString () const
 Returns a short textual description of this object. More...
 
virtual long hashValue () const
 Returns a hash value for this object. More...
 
virtual bool equals (const Ref< Object > &obj) const
 Tests whether two objects are equal. More...
 
Ref< Objectclone () const
 Returns a copy of this object. More...
 

Protected Member Functions

virtual ~WeakHashMap ()
 
- Protected Member Functions inherited from jem::util::ObjectMap
virtual ~ObjectMap ()
 
void clone_ (const ObjectMap &rhs)
 
void readFrom_ (io::ObjectInput &in)
 
void writeTo_ (io::ObjectOutput &out) const
 
- Protected Member Functions inherited from jem::util::ObjectCollection
virtual ~ObjectCollection ()
 
void clone_ (const ObjectCollection &rhs)
 Makes a deep copy of another collection. More...
 
void readFrom_ (io::ObjectInput &in)
 Reads the contents of this collection from an object input stream. More...
 
void writeTo_ (io::ObjectOutput &out) const
 Writes the contents of this collection to an object output stream. More...
 
- Protected Member Functions inherited from jem::Collectable
 Collectable ()
 Creates an empty Collectable. More...
 
 ~Collectable ()
 Frees resources. More...
 
- Protected Member Functions inherited from jem::util::Enumerable
virtual ~Enumerable ()
 
- Protected Member Functions inherited from jem::Interface
virtual ~Interface ()
 Empty destructor. More...
 
- Protected Member Functions inherited from jem::Clonable
virtual ~Clonable ()
 
virtual void emitVTable_ ()
 
- Protected Member Functions inherited from jem::io::Serializable
virtual ~Serializable ()
 
virtual void emitVtableFunc_ ()
 

Friends

class Enumerator_
 

Additional Inherited Members

- Static Public Member Functions inherited from jem::util::ObjectCollection
static ClassmakeClass ()
 
static ClassgetType ()
 
- Static Public Member Functions inherited from jem::Object
static ClassgetType ()
 Returns the Class instance representing the Object class. More...
 

Constructor & Destructor Documentation

jem::util::WeakHashMap::WeakHashMap ( )
virtual jem::util::WeakHashMap::~WeakHashMap ( )
protectedvirtual

Member Function Documentation

virtual void jem::util::WeakHashMap::readFrom ( io::ObjectInput in)
virtual

Implements jem::io::Serializable.

virtual void jem::util::WeakHashMap::writeTo ( io::ObjectOutput out) const
virtual

Implements jem::io::Serializable.

virtual Ref<Object> jem::util::WeakHashMap::clone ( ) const
virtual

Implements jem::Clonable.

virtual Ref<MapEnum> jem::util::WeakHashMap::getMapEnum ( ) const
virtual

Implements jem::util::ObjectMap.

virtual Ref<Object> jem::util::WeakHashMap::get ( const Ref< Object > &  key) const
virtual

Reimplemented from jem::util::ObjectMap.

virtual bool jem::util::WeakHashMap::find ( Ref< Object > &  value,
const Ref< Object > &  key 
) const
virtual

Implements jem::util::ObjectMap.

virtual void jem::util::WeakHashMap::insert ( const Ref< Object > &  key,
const Ref< Object > &  value 
)
virtual

Implements jem::util::ObjectMap.

virtual void jem::util::WeakHashMap::erase ( const Ref< Object > &  key)
virtual

Implements jem::util::ObjectMap.

virtual void jem::util::WeakHashMap::clear ( )
virtual

Deletes all objects from this collection.

This function may not be called if an enumerator points to this collection.

Postcondition
this->size() == 0

Implements jem::util::ObjectCollection.

virtual void jem::util::WeakHashMap::reserve ( idx_t  count)
virtual
virtual void jem::util::WeakHashMap::trimToSize ( )
virtual

Notifies this collection that it should deallocate non-used memory. Call this function after you have added all objects to this collection.

For efficiency reasons, an ObjectCollection may allocate extra memory each time that an object is added and no more free space is left in its internal data structures. This means that the ObjectCollection may use more memory than is actually needed to store all objects. This member function informs the ObjectCollection that no more new objects will be added and that it should shrink its data structures as much as possible.

This function may not be called if an enumerator points to this collection.

See also
reserve(), capacity()

Reimplemented from jem::util::ObjectCollection.

virtual idx_t jem::util::WeakHashMap::capacity ( ) const
virtual

Returns the number of objects that this collection can contain without having to expand its internal data structures. This number is called the capacity of this collection.

The implementation of this function provided by the ObjectCollection class simply returns size().

Returns
The capacity of this collection.

Reimplemented from jem::util::ObjectCollection.

virtual idx_t jem::util::WeakHashMap::size ( ) const
virtual

Returns the number of objects in this collection.

Returns
The number of objects in this collection.

Implements jem::util::ObjectCollection.

Friends And Related Function Documentation

friend class Enumerator_
friend