update detection mechanism based comparing the difference between the position of...
[vamsas.git] / src / uk / ac / vamsas / client / Vobjhash.java
index f2feab9..767a9a6 100644 (file)
@@ -2,24 +2,27 @@ package uk.ac.vamsas.client;
 \r
 /**\r
  * Holds information about Vobj instances that is held over between different writes to the document.\r
+ * Currently records the LhashValue obtained from Vobject\r
  * @author JimP\r
  *\r
  */\r
 public class Vobjhash {\r
-  int hashvalue;\r
+  long hashvalue;\r
   /**\r
    * creates a record of the hash value for a vamsas document object\r
    * @param tobemarshalled\r
    */\r
   public Vobjhash(Vobject tobemarshalled) {\r
-    hashvalue = tobemarshalled.get__last_hash();\r
+    hashvalue = tobemarshalled.__getLHash();\r
   }\r
   /**\r
-   * compares the old hash value with the unmarshalled object's most recently computed hash value.\r
+   * compares the old hash value with the unmarshalled object's most recently computed hash value and updates internal record.\r
    * @param unmarshalled\r
    * @return true if the hash values differ\r
    */\r
   public boolean isUpdated(Vobject unmarshalled) {\r
-    return hashvalue==unmarshalled.get__last_hash();\r
+    long oldhash = hashvalue;\r
+    hashvalue=unmarshalled.__getLHash();\r
+    return oldhash!=hashvalue;\r
   }\r
 }\r