Incrementing on definite reach analysis
[IRC.git] / Robust / src / Util / MultiViewMap.java
index 2cf626d038d484806ce9422509bf0388f37c219d..aad5f0bbb7c5b8d5ff444319265a46343e1176a3 100644 (file)
@@ -77,6 +77,40 @@ public class MultiViewMap<T> {
     return fullKey2value.size();\r
   }\r
 \r
+  public boolean equals( Object o ) {\r
+    if( this == o ) {\r
+      return true;\r
+    }\r
+    if( o == null ) {\r
+      return false;\r
+    }\r
+    if( !(o instanceof MultiViewMap) ) {\r
+      return false;\r
+    }\r
+    MultiViewMap that = (MultiViewMap) o;\r
+\r
+    // check whether key types and views match\r
+    if( !this.isHomogenous( that ) ) {\r
+      return false;\r
+    }\r
+    \r
+    // check contents\r
+    return fullKey2value.equals( that.fullKey2value ) &&\r
+      view2partialKey2fullKeys.equals( that.view2partialKey2fullKeys );\r
+  }\r
+\r
+  public int hashCode() {\r
+    int hash = 1;\r
+    hash = hash*31 + keyTypes.hashCode();\r
+    hash = hash*31 + joinOp.hashCode();\r
+    hash = hash*31 + fullView.hashCode();\r
+    hash = hash*31 + partialViews.hashCode();\r
+    hash = hash*31 + fullKey2value.hashCode();\r
+    hash = hash*31 + view2partialKey2fullKeys.hashCode();\r
+    return hash;\r
+  }\r
+\r
+\r
  \r
   public void put( MultiKey fullKey, T value ) {\r
     assert( typesMatch( fullKey ) );\r
@@ -233,7 +267,8 @@ public class MultiViewMap<T> {
     }\r
     return \r
       this.partialViews.equals( in.partialViews ) &&\r
-      this.fullView.equals( in.fullView );\r
+      this.fullView.equals( in.fullView ) &&\r
+      this.joinOp.equals( in.joinOp );\r
   }\r
 \r
 \r