tentative checkpoint ROLL THIS BACK BUT INCLUDES CRUCIAL FIX
[sbp.git] / src / edu / berkeley / sbp / util / IntPairMap.java
index db12004..a45c6c3 100644 (file)
@@ -3,7 +3,7 @@ import java.util.*;
 
 // FEATURE: make this faster (plenty of ways: quadradic probing hash table is one)
 /** a sparse mapping from pairs of <tt>int</tt>'s to <tt>V</tt>'s */
-public final class IntPairMap<V> {
+public final class IntPairMap<V> implements Iterable<V> {
 
     private final HashMap<Long, V> hm = new HashMap<Long, V>();
 
@@ -16,4 +16,5 @@ public final class IntPairMap<V> {
     public Iterable<V> values() { return hm.values(); }
     public int size() { return hm.size(); }
     public void toArray(V[] v) { hm.values().toArray(v); }
+    public Iterator<V> iterator() { return hm.values().iterator(); }
 }