*/
package jalview.ws.seqfetcher;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceI;
import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
+import jalview.util.QuickSort;
import java.util.ArrayList;
import java.util.Enumeration;
public String[] getSupportedDb()
{
if (FETCHABLEDBS == null)
+ {
return null;
+ }
String[] sf = new String[FETCHABLEDBS.size()];
Enumeration e = FETCHABLEDBS.keys();
int i = 0;
{
String db = (String) e.nextElement();
if (source.compareToIgnoreCase(db) == 0)
+ {
return true;
+ }
}
- jalview.bin.Cache.log.warn("isFetchable doesn't know about '" + source
+ Cache.log.warn("isFetchable doesn't know about '" + source
+ "'");
return false;
}
- public SequenceI[] getSequences(jalview.datamodel.DBRefEntry[] refs)
+ public SequenceI[] getSequences(DBRefEntry[] refs)
{
SequenceI[] ret = null;
Vector<SequenceI> rseqs = new Vector();
*/
System.out.println(hdr);
if (rrb != null)
+ {
System.out.println(rrb);
+ }
System.out.println("# end of " + hdr);
}
{
nm[i++] = "" + s.getTier() + s.getDbName().toLowerCase();
}
- jalview.util.QuickSort.sort(nm, l);
+ QuickSort.sort(nm, l);
dbs = new ArrayList<DbSourceProxy>();
for (i = l.length - 1; i >= 0; i--)
{
* @param dbSourceProxy
* reference for class implementing
* jalview.ws.seqfetcher.DbSourceProxy
- * @throws java.lang.IllegalArgumentException
- * if class does not implement jalview.ws.seqfetcher.DbSourceProxy
*/
- protected void addDBRefSourceImpl(Class dbSourceProxy)
+ protected void addDBRefSourceImpl(
+ Class<? extends DbSourceProxy> dbSourceProxy)
throws java.lang.IllegalArgumentException
{
DbSourceProxy proxy = null;
try
{
- Object proxyObj = dbSourceProxy.getConstructor(null)
- .newInstance(null);
- if (!DbSourceProxy.class.isInstance(proxyObj))
- {
- throw new IllegalArgumentException(
- dbSourceProxy.toString()
- + " does not implement the jalview.ws.seqfetcher.DbSourceProxy");
- }
- proxy = (DbSourceProxy) proxyObj;
+ DbSourceProxy proxyObj = dbSourceProxy.getConstructor().newInstance();
+ proxy = proxyObj;
} catch (IllegalArgumentException e)
{
throw e;
*/
public String[] getDbInstances(Class class1)
{
- if (!jalview.ws.seqfetcher.DbSourceProxy.class.isAssignableFrom(class1))
+ if (!DbSourceProxy.class.isAssignableFrom(class1))
{
throw new Error(MessageManager.formatMessage("error.implementation_error_dbinstance_must_implement_interface", new String[]{class1.toString()}));
}
{
ArrayList<DbSourceProxy> prlist = new ArrayList<DbSourceProxy>();
for (String fetchable : getSupportedDb())
+ {
for (DbSourceProxy pr : getSourceProxy(fetchable))
{
if (class1.isInstance(pr))
prlist.add(pr);
}
}
+ }
if (prlist.size() == 0)
{
return null;