#ifndef __HASHMAP_H__
#define __HASHMAP_H__

#include <string>

#include "treemap.h"

class HashMap
{
public:
  typedef string ItemType;
  typedef double ValueType;

  HashMap();
  ~HashMap();

  int getSize() const;
  ValueType getValue(const ItemType& i) const;
  bool contains(const ItemType& i) const;
  
  void makeEmpty();
  void addItem(const ItemType&, const ValueType& val);
  
private:
  // prohibit copying until we feel like writing deep copy methods
  HashMap(const HashMap&);
  HashMap& operator = (const HashMap&);

  int hashValue(const ItemType&) const;

  static const int DEFAULT_BUCKETS = 511;

  TreeMap *buckets;
  int numBuckets;
  int numItems;
};

#endif

