changes.
[IRC.git] / Robust / src / Util / Lattice.java
index 7c744f62da918502762c6236b55ca6bfcd83a8cb..aea74773d7ca8936c00105a61a8d6cd6283423bd 100644 (file)
@@ -20,6 +20,7 @@ public class Lattice<T> {
     this.bottom = bottom;
 
     table.put(top, new HashSet<T>());
+    table.put(bottom, new HashSet<T>());
 
   }
 
@@ -39,6 +40,17 @@ public class Lattice<T> {
     return table;
   }
 
+  public void setTable(Map<T, Set<T>> in) {
+    Set<T> keySet = in.keySet();
+    for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
+      T key = (T) iterator.next();
+      Set<T> setIn = in.get(key);
+      Set<T> newSet = new HashSet<T>();
+      newSet.addAll(setIn);
+      table.put(key, newSet);
+    }
+  }
+
   public boolean put(T key) {
     if (table.containsKey(key)) {
       return false;