001 /* 002 * Created on Sep 8, 2004 003 * 004 */ 005 package aima.search.framework; 006 007 import java.util.Hashtable; 008 import java.util.Set; 009 010 /** 011 * @author Ravi Mohan 012 * 013 */ 014 015 public class Metrics { 016 private Hashtable<String, String> hash; 017 018 public Metrics() { 019 this.hash = new Hashtable<String, String>(); 020 } 021 022 public void set(String name, int i) { 023 hash.put(name, Integer.toString(i)); 024 } 025 026 public void set(String name, double d) { 027 hash.put(name, Double.toString(d)); 028 } 029 030 public int getInt(String name) { 031 return new Integer(hash.get(name)).intValue(); 032 } 033 034 public double getDouble(String name) { 035 return new Double(hash.get(name)).doubleValue(); 036 } 037 038 public String get(String name) { 039 return hash.get(name); 040 } 041 042 public Set keySet() { 043 return hash.keySet(); 044 } 045 }