Classes | Public Member Functions

nanojit::TreeMap< K, T > Class Template Reference

Simple binary tree. More...

#include <Containers.h>

Collaboration diagram for nanojit::TreeMap< K, T >:

List of all members.

Classes

class  Node

Public Member Functions

 TreeMap (Allocator &alloc)
void put (K k, T v)
 set k = v in the map.
findNear (K k)
 return the closest key that is <= k, or NULL if k is smaller than every key in the Map.
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.

Detailed Description

template<class K, class T>
class nanojit::TreeMap< K, T >

Simple binary tree.

No balancing is performed under the assumption that the only users of this structure are not performance critical.


Constructor & Destructor Documentation

template<class K , class T >
nanojit::TreeMap< K, T >::TreeMap ( Allocator alloc  )  [inline]

Member Function Documentation

template<class K , class T >
void nanojit::TreeMap< K, T >::clear (  )  [inline]

make the tree empty.

trivial since we dont manage elements

template<class K , class T >
bool nanojit::TreeMap< K, T >::containsKey ( k  )  [inline]

returns true iff k is in the Map.

template<class K , class T >
K nanojit::TreeMap< K, T >::findNear ( k  )  [inline]

return the closest key that is <= k, or NULL if k is smaller than every key in the Map.

template<class K , class T >
T nanojit::TreeMap< K, T >::get ( k  )  [inline]

returns the value for k or NULL

template<class K , class T >
void nanojit::TreeMap< K, T >::put ( k,
v 
) [inline]

set k = v in the map.

if k already exists, replace its value


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