Simple binary tree. More...
#include <Containers.h>
Collaboration diagram for nanojit::TreeMap< K, T >:Classes | |
| class | Node |
Public Member Functions | |
| TreeMap (Allocator &alloc) | |
| void | put (K k, T v) |
| set k = v in the map. | |
| K | findNear (K k) |
| return the closest key that is <= k, or NULL if k is smaller than every key in the Map. | |
| T | get (K k) |
| returns the value for k or NULL | |
| bool | containsKey (K k) |
| returns true iff k is in the Map. | |
| void | clear () |
| make the tree empty. | |
Simple binary tree.
No balancing is performed under the assumption that the only users of this structure are not performance critical.
| nanojit::TreeMap< K, T >::TreeMap | ( | Allocator & | alloc | ) | [inline] |
| void nanojit::TreeMap< K, T >::clear | ( | ) | [inline] |
make the tree empty.
trivial since we dont manage elements
| bool nanojit::TreeMap< K, T >::containsKey | ( | K | k | ) | [inline] |
returns true iff k is in the Map.
| K nanojit::TreeMap< K, T >::findNear | ( | K | k | ) | [inline] |
return the closest key that is <= k, or NULL if k is smaller than every key in the Map.
| T nanojit::TreeMap< K, T >::get | ( | K | k | ) | [inline] |
returns the value for k or NULL
| void nanojit::TreeMap< K, T >::put | ( | K | k, | |
| T | v | |||
| ) | [inline] |
set k = v in the map.
if k already exists, replace its value
1.7.1