X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fdatamodel%2FDBRefEntry.java;h=bc5588a8fe4ef02559a57b757afe0dcea02e6c03;hb=17e77c3f2949a0729322b4a8d907f3f34b6a9914;hp=2151fc410a303590b5637376388aea11647c5c68;hpb=ab43013b7e357b84b4abade0dba949668dfb2a0e;p=jalview.git diff --git a/src/jalview/datamodel/DBRefEntry.java b/src/jalview/datamodel/DBRefEntry.java index 2151fc4..bc5588a 100755 --- a/src/jalview/datamodel/DBRefEntry.java +++ b/src/jalview/datamodel/DBRefEntry.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -69,12 +69,20 @@ public class DBRefEntry (entry.map == null ? null : new Mapping(entry.map))); } - public boolean equals(DBRefEntry entry) + @Override + public boolean equals(Object o) { + // TODO should also override hashCode to ensure equal objects have equal + // hashcodes + if (o == null || !(o instanceof DBRefEntry)) + { + return false; + } + DBRefEntry entry = (DBRefEntry) o; if (entry == this) + { return true; - if (entry == null) - return false; + } if (equalRef(entry) && ((map == null && entry.map == null) || (map != null && entry.map != null && map.equals(entry.map)))) @@ -97,7 +105,9 @@ public class DBRefEntry return false; } if (entry == this) + { return true; + } if ((source != null && entry.source != null && source .equalsIgnoreCase(entry.source)) && (accessionId != null && entry.accessionId != null && accessionId @@ -183,4 +193,9 @@ public class DBRefEntry return ((source != null) ? source : "") + ":" + ((accessionId != null) ? accessionId : ""); } + + public String toString() + { + return getSrcAccString(); + } }