From: jprocter Date: Fri, 21 Dec 2007 14:59:49 +0000 (+0000) Subject: equivalence for transferring/updating references X-Git-Tag: Release_2_4~169 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=33d29753b74b33be28fef39da85fc9fbb256f6c8;p=jalview.git equivalence for transferring/updating references --- diff --git a/src/jalview/datamodel/DBRefEntry.java b/src/jalview/datamodel/DBRefEntry.java index 03445cd..7491da2 100755 --- a/src/jalview/datamodel/DBRefEntry.java +++ b/src/jalview/datamodel/DBRefEntry.java @@ -32,8 +32,15 @@ public class DBRefEntry { this(source, version, accessionId, null); } + /** + * + * @param source canonical source (uppercase only) + * @param version (source dependent version string) + * @param accessionId (source dependent accession number string) + * @param map (mapping from local sequence numbering to source accession numbering) + */ public DBRefEntry(String source, String version, String accessionId, Mapping map) { - this.source = source; + this.source = source.toUpperCase(); this.version = version; this.accessionId = accessionId; this.map = map; @@ -67,7 +74,7 @@ public class DBRefEntry } if (entry==this) return true; - if ((source!=null && entry.source!=null && source.equals(entry.source)) + if ((source!=null && entry.source!=null && source.equalsIgnoreCase(entry.source)) && (accessionId!=null && entry.accessionId!=null && accessionId.equalsIgnoreCase(entry.accessionId)) && diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index 7cd6a80..69f0d68 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -27,6 +27,23 @@ public class PDBEntry String id; Hashtable properties; + /* (non-Javadoc) + * @see java.lang.Object#equals(java.lang.Object) + */ + public boolean equals(Object obj) + { + if (obj==null || !(obj instanceof PDBEntry)) + { + return false; + } + if (obj==this) + return true; + PDBEntry o = (PDBEntry) obj; + return (file==o.file || (file!=null && o.file!=null && o.file.equals(file))) + && (type==o.type || (type!=null && o.type!=null && o.type.equals(type))) + && (id==o.id || (id!=null && o.id!=null && o.id.equalsIgnoreCase(id))) + && (properties==o.properties || (properties!=null && o.properties!=null && properties.equals(o.properties))); + } public PDBEntry() {} public PDBEntry(PDBEntry entry) {