X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Futil%2FDBRefUtils.java;h=3587b83ca7557a8c416e0816629ec6f55621c2b9;hb=1b5ee75e7538b6229da397b28a91296e612d23e8;hp=5aed125bfe1a08bfa8b647ee3319924aa723ca90;hpb=174230b4233d9ce80f94527768d2cd2f76da11ab;p=jalview.git diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 5aed125..3587b83 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -1,6 +1,6 @@ /* * Jalview - A Sequence Alignment Editor and Viewer - * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle + * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -22,45 +22,55 @@ import java.util.*; import jalview.datamodel.*; - public class DBRefUtils { - /** - * Utilities for handling DBRef objects and their collections. - */ - /** - * - * @param dbrefs Vector of DBRef objects to search - * @param sources String[] array of source DBRef IDs to retrieve - * @return Vector - */ - public static DBRefEntry [] selectRefs(DBRefEntry [] dbrefs, String[] sources) { - if (dbrefs==null) - return null; - if (sources==null) - return dbrefs; - Hashtable srcs = new Hashtable(); - Vector res=new Vector(); + /** + * Utilities for handling DBRef objects and their collections. + */ + /** + * + * @param dbrefs Vector of DBRef objects to search + * @param sources String[] array of source DBRef IDs to retrieve + * @return Vector + */ + public static DBRefEntry[] selectRefs(DBRefEntry[] dbrefs, String[] sources) + { + if (dbrefs == null) + { + return null; + } + if (sources == null) + { + return dbrefs; + } + Hashtable srcs = new Hashtable(); + Vector res = new Vector(); - for (int i=0; i0) + if (res.size() > 0) + { + DBRefEntry[] reply = new DBRefEntry[res.size()]; + for (int i = 0; i < res.size(); i++) { - DBRefEntry [] reply = new DBRefEntry[res.size()]; - for(int i=0; i