From: jprocter Date: Fri, 13 Jul 2007 14:55:21 +0000 (+0000) Subject: new search method for finding references like other references. X-Git-Tag: Release_2_4~361 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=606758592f2aa33b342ad7c641d02a67411f11dd;p=jalview.git new search method for finding references like other references. --- diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 3ea47f2..f016fe6 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -127,4 +127,41 @@ public class DBRefUtils } return canonical; } + /** + * find RefEntry corresponding to a particular pattern + * the equals method of each entry is used, from String attributes right down to Mapping attributes. + * @param ref Set of references to search + * @param entry pattern to collect - null any entry for wildcard match + * @return + */ + public static DBRefEntry[] searchRefs(DBRefEntry[] ref, DBRefEntry entry) + { + if (ref==null || entry==null) + return null; + Vector rfs = new Vector(); + for (int i=0; i0) + { + DBRefEntry[] rf = new DBRefEntry[rfs.size()]; + rfs.copyInto(rf); + return rf; + } + return null; + } }