update detection mechanism based comparing the difference between the position of...
[vamsas.git] / src / uk / ac / vamsas / client / Vobjhash.java
1 package uk.ac.vamsas.client;\r
2 \r
3 /**\r
4  * Holds information about Vobj instances that is held over between different writes to the document.\r
5  * Currently records the LhashValue obtained from Vobject\r
6  * @author JimP\r
7  *\r
8  */\r
9 public class Vobjhash {\r
10   long hashvalue;\r
11   /**\r
12    * creates a record of the hash value for a vamsas document object\r
13    * @param tobemarshalled\r
14    */\r
15   public Vobjhash(Vobject tobemarshalled) {\r
16     hashvalue = tobemarshalled.__getLHash();\r
17   }\r
18   /**\r
19    * compares the old hash value with the unmarshalled object's most recently computed hash value and updates internal record.\r
20    * @param unmarshalled\r
21    * @return true if the hash values differ\r
22    */\r
23   public boolean isUpdated(Vobject unmarshalled) {\r
24     long oldhash = hashvalue;\r
25     hashvalue=unmarshalled.__getLHash();\r
26     return oldhash!=hashvalue;\r
27   }\r
28 }\r