return true;
if (entry==null)
return false;
- if ((source!=null && entry.source!=null && source.equals(entry.source))
- &&
- (accessionId!=null && entry.accessionId!=null && accessionId.equals(entry.accessionId))
- &&
- (version!=null && entry.version!=null && version.equals(entry.version))
- &&
+ if (equalRef(entry)
+ &&
((map==null && entry.map==null) || (map!=null && entry.map!=null && map.equals(entry.map)))) {
return true;
}
return false;
}
+ /**
+ * test for similar DBRef attributes, except for the map object.
+ * @param entry
+ * @return true if source, accession and version are equal with those of entry
+ */
+ public boolean equalRef(DBRefEntry entry)
+ {
+ if (entry==null)
+ {
+ return false;
+ }
+ if (entry==this)
+ return true;
+ if ((source!=null && entry.source!=null && source.equals(entry.source))
+ &&
+ (accessionId!=null && entry.accessionId!=null && accessionId.equals(entry.accessionId))
+ &&
+ (version!=null && entry.version!=null && version.equals(entry.version))
+ )
+ {
+ return true;
+ }
+ return false;
+ }
public String getSource()
{
return source;