1 package uk.ac.vamsas.client;
\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
9 public class Vobjhash {
\r
10 private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(Vobjhash.class);
\r
13 * creates a record of the hash value for a vamsas document object
\r
14 * @param tobemarshalled
\r
16 public Vobjhash(Vobject tobemarshalled) {
\r
17 tobemarshalled.doHash();
\r
18 hashvalue = tobemarshalled.get__last_hash();
\r
19 if (log.isDebugEnabled())
\r
20 log.debug(tobemarshalled.getVorbaId()+":"+hashvalue);
\r
23 * compares the old hash value with the unmarshalled object's most recently computed hash value and updates internal record.
\r
24 * @param unmarshalled
\r
25 * @return true if the hash values differ
\r
27 public boolean isUpdated(Vobject unmarshalled) {
\r
28 long oldhash = hashvalue;
\r
29 unmarshalled.doHash();
\r
30 hashvalue=unmarshalled.get__last_hash();
\r
31 if (log.isDebugEnabled() && oldhash!=hashvalue)
\r
32 log.debug(" has changed."+unmarshalled.getVorbaId());
\r
33 return oldhash!=hashvalue;
\r