Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
|
#include <unordered_list_map.h>
Data Structures | |
class | iter_rep |
Public Member Functions | |
UnorderedListMap () | |
Creates an empty map. | |
int | size () const |
Returns the number of entries in the map. | |
const_iterator | begin () const |
Returns iterator to first entry. | |
const_iterator | end () const |
Returns iterator representing the end. | |
const_iterator | find (const Key &k) const |
Returns a iterator to the entry with a given key, or end() if no such entry exists. | |
const_iterator | put (const Key &k, const Value &v) |
const_iterator | erase (const_iterator loc) |
Removes the entry indicated by the given iterator, and returns iterator to next entry in iteration order. | |
bool | erase (const Key &k) |
virtual const_iterator | erase (const_iterator loc)=0 |
![]() | |
bool | empty () const |
Returns true if the map is empty, false otherwise. | |
bool | contains (const Key &k) const |
Returns true if the map contains an entry with the given key. | |
const Value & | at (const Key &k) const |
bool | erase (const Key &k) |
virtual | ~AbstractMap () |
virtual int | size () const =0 |
virtual const_iterator | begin () const =0 |
virtual const_iterator | end () const =0 |
virtual const_iterator | find (const Key &k) const =0 |
virtual const_iterator | put (const Key &k, const Value &v)=0 |
virtual const_iterator | erase (const_iterator loc)=0 |
Additional Inherited Members | |
![]() | |
abstract_iter_rep * | get_rep (const_iterator iter) const |
void | update_value (const Entry &e, const Value &v) |
|
inline |
Creates an empty map.
|
inlinevirtual |
Returns iterator to first entry.
Implements dsac::map::AbstractMap< Key, Value >.
|
inlinevirtual |
Returns iterator representing the end.
Implements dsac::map::AbstractMap< Key, Value >.
|
inline |
Erases entry with given key (if one exists) Returns true if an entry was removed, false otherwise
|
inlinevirtual |
Removes the entry indicated by the given iterator, and returns iterator to next entry in iteration order.
Implements dsac::map::AbstractMap< Key, Value >.
|
virtual |
Implements dsac::map::AbstractMap< Key, Value >.
|
inlinevirtual |
Returns a iterator to the entry with a given key, or end() if no such entry exists.
Implements dsac::map::AbstractMap< Key, Value >.
|
inlinevirtual |
Associates given key with given value. If key already exists previous value is overwritten. Returns an iterator to the entry associated with the key
Implements dsac::map::AbstractMap< Key, Value >.
|
inlinevirtual |
Returns the number of entries in the map.
Implements dsac::map::AbstractMap< Key, Value >.