X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fclient%2FVobjhash.java;h=6052faf193855ca4cddeaef1318c6a6820fe3b2d;hb=844ccad5a3fcbedec17b2af66d460f31abc7cff1;hp=1b258dc4abd9bcc729d24cd6849b26189523d64e;hpb=11dfd6edca6d81c20e7ae0f6098b5a0251611473;p=vamsas.git diff --git a/src/uk/ac/vamsas/client/Vobjhash.java b/src/uk/ac/vamsas/client/Vobjhash.java index 1b258dc..6052faf 100644 --- a/src/uk/ac/vamsas/client/Vobjhash.java +++ b/src/uk/ac/vamsas/client/Vobjhash.java @@ -1,35 +1,65 @@ +/* + * This file is part of the Vamsas Client version 0.1. + * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, + * Andrew Waterhouse and Dominik Lindner. + * + * Earlier versions have also been incorporated into Jalview version 2.4 + * since 2008, and TOPALi version 2 since 2007. + * + * The Vamsas Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Vamsas Client is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the Vamsas Client. If not, see . + */ package uk.ac.vamsas.client; /** - * Holds information about Vobj instances that is held over between different writes to the document. - * Currently records the LhashValue obtained from Vobject + * Holds information about Vobj instances that is held over between different + * writes to the document. Currently records the LhashValue obtained from + * Vobject + * * @author JimP - * + * */ public class Vobjhash { - private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(Vobjhash.class); - long hashvalue; + private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(Vobjhash.class); + + long hashvalue; + /** * creates a record of the hash value for a vamsas document object + * * @param tobemarshalled */ public Vobjhash(Vobject tobemarshalled) { tobemarshalled.doHash(); hashvalue = tobemarshalled.get__last_hash(); if (log.isDebugEnabled()) - log.debug(tobemarshalled.getVorbaId()+":"+hashvalue); + log.debug(tobemarshalled.getVorbaId() + ":" + hashvalue); } + /** - * compares the old hash value with the unmarshalled object's most recently computed hash value and updates internal record. + * compares the old hash value with the unmarshalled object's most recently + * computed hash value and updates internal record. + * * @param unmarshalled * @return true if the hash values differ */ public boolean isUpdated(Vobject unmarshalled) { long oldhash = hashvalue; unmarshalled.doHash(); - hashvalue=unmarshalled.get__last_hash(); - if (log.isDebugEnabled() && oldhash!=hashvalue) - log.debug(" has changed."+unmarshalled.getVorbaId()); - return oldhash!=hashvalue; + hashvalue = unmarshalled.get__last_hash(); + if (log.isDebugEnabled() && oldhash != hashvalue) + log.debug(" has changed." + unmarshalled.getVorbaId()); + return oldhash != hashvalue; } }