}
/**
+ * Returns an array of those references that match the given accession id
+ * <ul>
+ * <li>database sources are the same</li>
+ * <li>accession ids are the same</li>
+ * <li>both have no mapping, or the mappings are the same</li>
+ * </ul>
+ *
+ * @param ref
+ * Set of references to search
+ * @param entry
+ * pattern to match
+ * @return
+ */
+ public static DBRefEntry[] searchRefs(DBRefEntry[] ref, String accId)
+ {
+ return searchRefs(ref, new DBRefEntry("", "", accId), matchId);
+ }
+
+ /**
* Returns an array of those references that match the given entry, according
* to the given comparator. Returns null if no matches.
*
};
/**
+ * accession ID only must be identical.
+ */
+ public static DbRefComp matchId = new DbRefComp()
+ {
+ @Override
+ public boolean matches(DBRefEntry refa, DBRefEntry refb)
+ {
+ if (refa.getAccessionId() != null && refb.getAccessionId() != null
+ && refb.getAccessionId().equals(refa.getAccessionId()))
+ {
+ return true;
+ }
+ return false;
+ }
+ };
+
+ /**
* Parses a DBRefEntry and adds it to the sequence, also a PDBEntry if the
* database is PDB.
* <p>