manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1208047 - in /incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore: TableColumnKey.java TableRowKey.java
Date Tue, 29 Nov 2011 19:50:43 GMT
Author: kwright
Date: Tue Nov 29 19:50:42 2011
New Revision: 1208047

URL: http://svn.apache.org/viewvc?rev=1208047&view=rev
Log:
Complete standard hash and equals functions for all keys and values.

Modified:
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableColumnKey.java
    incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableRowKey.java

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableColumnKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableColumnKey.java?rev=1208047&r1=1208046&r2=1208047&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableColumnKey.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableColumnKey.java
Tue Nov 29 19:50:42 2011
@@ -77,4 +77,22 @@ public class TableColumnKey implements W
       key.rowID == rowID &&
       key.columnName.equals(columnName);
   }
+  
+  public int hashCode()
+  {
+    return ((int)((tableID << 5) ^ (tableID >>3))) +
+      ((int)((rowID << 5) ^ (rowID >> 3))) +
+      columnName.hashCode();
+  }
+  
+  public boolean equals(Object o)
+  {
+    if (getClass() != o.getClass())
+      return false;
+    TableColumnKey other = (TableColumnKey)o;
+    return other.tableID == tableID &&
+      other.rowID == rowID &&
+      other.columnName.equals(columnName);
+  }
+  
 }

Modified: incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableRowKey.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableRowKey.java?rev=1208047&r1=1208046&r2=1208047&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableRowKey.java
(original)
+++ incubator/lcf/branches/CONNECTORS-286/warthog/src/main/java/org/apache/warthog/tablestore/TableRowKey.java
Tue Nov 29 19:50:42 2011
@@ -73,4 +73,19 @@ public class TableRowKey implements WHKe
       key.rowID == rowID;
   }
 
+  public int hashCode()
+  {
+    return ((int)((tableID << 5) ^ (tableID >> 3))) +
+      ((int)((rowID << 5) ^ (rowID >> 3)));
+  }
+  
+  public boolean equals(Object o)
+  {
+    if (getClass() != o.getClass())
+      return false;
+    TableRowKey other = (TableRowKey)o;
+    return other.tableID == tableID &&
+      other.rowID == rowID;
+  }
+  
 }



Mime
View raw message