version 3.3

VRS::NonPersistentDictionary< K, V > Class Template Reference

Dictionary Template. More...

#include <vrs/container/dictionary.h>

Inheritance diagram for VRS::NonPersistentDictionary< K, V >:

VRS::SharedObj VRS::Visitable VRS::Dictionary< K, V >

List of all members.

Public Member Functions

 NonPersistentDictionary (unsigned int estimatedElements=0)
void setValue (const K &key, const V &value)
const V & getValue (const K &key) const
const V & operator[] (const K &key) const
V & operator[] (const K &key)
bool find (const K &key, V &result) const
bool contains (const K &key) const
int size () const
 Returns true, if the dictonary is empty.
bool isEmpty () const
 Returns the number of entries.
bool insert (const K &key, const V &v)
bool erase (const K &key)
void clear ()
Iterator< K > * newKeyIterator () const
 Creates an iterator instance for the keys.
Iterator< V > * newValueIterator () const
 Creates an iterator instance for the values.
 VRS_TYPEINFO (NonPersistentDictionary, SharedObj)
 VRS_SERIALIZABLE_ABSTRACT_CLASS (NonPersistentDictionary)


Detailed Description

template<typename K, typename V>
class VRS::NonPersistentDictionary< K, V >

Dictionary Template.

Constructor & Destructor Documentation

template<typename K, typename V>
VRS::NonPersistentDictionary< K, V >::NonPersistentDictionary ( unsigned int  estimatedElements = 0  ) 

`Dictionary<K,T>' : dictionary class implemented by hashtables. `K': key class, `T': class of associated data. If the number of elements is known during construction, the access performance will be optimized. Constraints for the template classes:


Member Function Documentation

template<typename K, typename V>
void VRS::NonPersistentDictionary< K, V >::setValue ( const K &  key,
const V &  value 
)

template<typename K, typename V>
const V& VRS::NonPersistentDictionary< K, V >::getValue ( const K &  key  )  const

template<typename K, typename V>
const V& VRS::NonPersistentDictionary< K, V >::operator[] ( const K &  key  )  const

template<typename K, typename V>
V& VRS::NonPersistentDictionary< K, V >::operator[] ( const K &  key  ) 

`operator[]' : element access which asserts that the dictionary contains the element with key `k'.

template<typename K, typename V>
bool VRS::NonPersistentDictionary< K, V >::find ( const K &  key,
V &  result 
) const

If key "key" is included, "result" is set to the value associated with "key", and true is returned. If no key "key" is included, "result" is not changed, and false is returned.

template<typename K, typename V>
bool VRS::NonPersistentDictionary< K, V >::contains ( const K &  key  )  const

Tries to find the given dictionary entry, and returns if such an key exists or not.

template<typename K, typename V>
int VRS::NonPersistentDictionary< K, V >::size (  )  const

Returns true, if the dictonary is empty.

template<typename K, typename V>
bool VRS::NonPersistentDictionary< K, V >::isEmpty (  )  const

Returns the number of entries.

template<typename K, typename V>
bool VRS::NonPersistentDictionary< K, V >::insert ( const K &  key,
const V &  v 
)

template<typename K, typename V>
bool VRS::NonPersistentDictionary< K, V >::erase ( const K &  key  ) 

template<typename K, typename V>
void VRS::NonPersistentDictionary< K, V >::clear (  ) 

`insert' includes "(key,v)" in the dictionary. If an entry with the same key already exists, it is overwritten, and false is returned. If such an entry has not been included before, true is returned. `erase' excludes the entry with key "key". If no entry with key "key" exists, an error occurs. `clear' removes all dictionary entries.

template<typename K, typename V>
Iterator<K>* VRS::NonPersistentDictionary< K, V >::newKeyIterator (  )  const

Creates an iterator instance for the keys.

template<typename K, typename V>
Iterator<V>* VRS::NonPersistentDictionary< K, V >::newValueIterator (  )  const

Creates an iterator instance for the values.

template<typename K, typename V>
VRS::NonPersistentDictionary< K, V >::VRS_TYPEINFO ( NonPersistentDictionary< K, V >  ,
SharedObj   
)

template<typename K, typename V>
VRS::NonPersistentDictionary< K, V >::VRS_SERIALIZABLE_ABSTRACT_CLASS ( NonPersistentDictionary< K, V >   ) 


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

Generated on Tue May 22 06:00:19 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact