X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fws%2Fseqfetcher%2FDbSourceProxyImpl.java;h=0785dfaeae68698428652d8e158cf0ef27870689;hb=f0abe70b5a54b6a9730aa5f4e2bf2bd697508757;hp=94d7577f41cc4b79517f9f80ac2f3a11ced6d591;hpb=56d8f0b05df600ea54388d58cf505d911beb630a;p=jalview.git
diff --git a/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java b/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
index 94d7577..0785dfa 100644
--- a/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
+++ b/src/jalview/ws/seqfetcher/DbSourceProxyImpl.java
@@ -1,139 +1,140 @@
-/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
- * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
- *
- * This file is part of Jalview.
- *
- * Jalview 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 3 of the License, or (at your option) any later version.
- *
- * Jalview 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 Jalview. If not, see .
- */
-package jalview.ws.seqfetcher;
-
-import jalview.datamodel.Alignment;
-import jalview.datamodel.DBRefSource;
-import jalview.io.FormatAdapter;
-import jalview.io.IdentifyFile;
-
-import java.util.Hashtable;
-
-/**
- * common methods for implementations of the DbSourceProxy interface.
- *
- * @author JimP
- *
- */
-public abstract class DbSourceProxyImpl implements DbSourceProxy
-{
- public DbSourceProxyImpl()
- {
- // default constructor - do nothing probably.
- }
-
- private Hashtable props = null;
-
- /*
- * (non-Javadoc)
- *
- * @see jalview.ws.DbSourceProxy#getDbSourceProperties()
- */
- public Hashtable getDbSourceProperties()
- {
- if (props == null)
- {
- props = new Hashtable();
- }
- return props;
- }
-
- protected void addDbSourceProperty(Object propname)
- {
- addDbSourceProperty(propname, propname);
- }
-
- protected void addDbSourceProperty(Object propname, Object propvalue)
- {
- if (props == null)
- {
- props = new Hashtable();
- }
- props.put(propname, propvalue);
- }
-
- boolean queryInProgress = false;
-
- protected StringBuffer results = null;
-
- /*
- * (non-Javadoc)
- *
- * @see jalview.ws.DbSourceProxy#getRawRecords()
- */
- public StringBuffer getRawRecords()
- {
- return results;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see jalview.ws.DbSourceProxy#queryInProgress()
- */
- public boolean queryInProgress()
- {
- return queryInProgress;
- }
-
- /**
- * call to set the queryInProgress flag
- *
- */
- protected void startQuery()
- {
- queryInProgress = true;
- }
-
- /**
- * call to clear the queryInProgress flag
- *
- */
- protected void stopQuery()
- {
- queryInProgress = false;
- }
-
- /**
- * create an alignment from raw text file...
- *
- * @param result
- * @return null or a valid alignment
- * @throws Exception
- */
- protected Alignment parseResult(String result) throws Exception
- {
- Alignment sequences = null;
- String format = new IdentifyFile().Identify(result, "Paste");
- if (FormatAdapter.isValidFormat(format))
- {
- sequences = new FormatAdapter().readFile(result.toString(), "Paste",
- format);
- }
- return sequences;
- }
-
- @Override
- public boolean isA(Object dbsourceproperty)
- {
- assert(dbsourceproperty!=null);
- return (props==null) ? false : props.containsKey(dbsourceproperty);
- }
-
-
-}
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview 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 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview 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 Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.ws.seqfetcher;
+
+import jalview.datamodel.AlignmentI;
+import jalview.io.FormatAdapter;
+import jalview.io.IdentifyFile;
+
+import java.util.Hashtable;
+
+/**
+ * common methods for implementations of the DbSourceProxy interface.
+ *
+ * @author JimP
+ *
+ */
+public abstract class DbSourceProxyImpl implements DbSourceProxy
+{
+ public DbSourceProxyImpl()
+ {
+ // default constructor - do nothing probably.
+ }
+
+ private Hashtable props = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.DbSourceProxy#getDbSourceProperties()
+ */
+ public Hashtable getDbSourceProperties()
+ {
+ if (props == null)
+ {
+ props = new Hashtable();
+ }
+ return props;
+ }
+
+ protected void addDbSourceProperty(Object propname)
+ {
+ addDbSourceProperty(propname, propname);
+ }
+
+ protected void addDbSourceProperty(Object propname, Object propvalue)
+ {
+ if (props == null)
+ {
+ props = new Hashtable();
+ }
+ props.put(propname, propvalue);
+ }
+
+ boolean queryInProgress = false;
+
+ protected StringBuffer results = null;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.DbSourceProxy#getRawRecords()
+ */
+ public StringBuffer getRawRecords()
+ {
+ return results;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see jalview.ws.DbSourceProxy#queryInProgress()
+ */
+ public boolean queryInProgress()
+ {
+ return queryInProgress;
+ }
+
+ /**
+ * call to set the queryInProgress flag
+ *
+ */
+ protected void startQuery()
+ {
+ queryInProgress = true;
+ }
+
+ /**
+ * call to clear the queryInProgress flag
+ *
+ */
+ protected void stopQuery()
+ {
+ queryInProgress = false;
+ }
+
+ /**
+ * create an alignment from raw text file...
+ *
+ * @param result
+ * @return null or a valid alignment
+ * @throws Exception
+ */
+ protected AlignmentI parseResult(String result) throws Exception
+ {
+ AlignmentI sequences = null;
+ String format = new IdentifyFile().Identify(result, "Paste");
+ if (FormatAdapter.isValidFormat(format))
+ {
+ sequences = new FormatAdapter().readFile(result.toString(), "Paste",
+ format);
+ }
+ return sequences;
+ }
+
+ @Override
+ public boolean isA(Object dbsourceproperty)
+ {
+ assert (dbsourceproperty != null);
+ return (props == null) ? false : props.containsKey(dbsourceproperty);
+ }
+
+}