X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FDBRefUtils.java;h=5aed125bfe1a08bfa8b647ee3319924aa723ca90;hb=e894eb87d40be6e8452d19032ddffe80dad5f804;hp=86ab201843b94a6509d9ffd877e3d4247b375f50;hpb=869913baf5d81e99c37727bae7ca8652e6abfb8b;p=jalview.git diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 86ab201..5aed125 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -1,32 +1,90 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer + * Copyright (C) 2006 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 + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ package jalview.util; -import java.util.Vector; -import java.util.Hashtable; +import java.util.*; + +import jalview.datamodel.*; + public class DBRefUtils { /** * Utilities for handling DBRef objects and their collections. */ - public static Vector selectRefs(java.util.Vector dbrefs, String[] sources) { + /** + * + * @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) - return res; + { + DBRefEntry [] reply = new DBRefEntry[res.size()]; + for(int i=0; i