Changes to return type of Executable.getType() method to make it compile with Oracle...
[jabaws.git] / runner / compbio / runner / conservation / AACon.java
index f43db89..a03dfd7 100644 (file)
@@ -20,21 +20,17 @@ import java.io.FileNotFoundException;
 import java.io.IOException;\r
 import java.io.InputStream;\r
 import java.util.Arrays;\r
-import java.util.HashSet;\r
 import java.util.List;\r
 \r
 import org.apache.log4j.Logger;\r
 \r
 import compbio.data.sequence.SMERFSConstraints;\r
-import compbio.data.sequence.Score;\r
+import compbio.data.sequence.ScoreManager;\r
 import compbio.data.sequence.SequenceUtil;\r
 import compbio.engine.client.CommandBuilder;\r
 import compbio.engine.client.Executable;\r
 import compbio.engine.client.SkeletalExecutable;\r
-import compbio.metadata.Limit;\r
-import compbio.metadata.LimitsManager;\r
 import compbio.metadata.ResultNotAvailableException;\r
-import compbio.runner.Util;\r
 \r
 /**\r
  * Command line\r
@@ -56,9 +52,6 @@ public class AACon extends SkeletalExecutable<AACon> {
 \r
        private final String ncorePrm = "-t=";\r
 \r
-       // Cache for Limits information\r
-       private static LimitsManager<AACon> limits;\r
-\r
        public static final String KEY_VALUE_SEPARATOR = "=";\r
        public static final String STAT_FILE = "stat.txt";\r
 \r
@@ -72,13 +65,14 @@ public class AACon extends SkeletalExecutable<AACon> {
        }\r
        // HashMap<Method, float[]>\r
        @Override\r
-       public HashSet<Score> getResults(String workDirectory)\r
+       public ScoreManager getResults(String workDirectory)\r
                        throws ResultNotAvailableException {\r
-               HashSet<Score> annotations = null;\r
+               ScoreManager annotations = null;\r
                try {\r
                        InputStream inStream = new FileInputStream(new File(workDirectory,\r
                                        getOutput()));\r
-                       annotations = SequenceUtil.readAAConResults(inStream);\r
+                       annotations = ScoreManager.newInstanceSingleSequence(SequenceUtil\r
+                                       .readAAConResults(inStream));\r
                        inStream.close();\r
                } catch (FileNotFoundException e) {\r
                        log.error(e.getMessage(), e.getCause());\r
@@ -128,40 +122,10 @@ public class AACon extends SkeletalExecutable<AACon> {
                return this;\r
        }\r
 \r
+       @SuppressWarnings("unchecked")\r
        @Override\r
-       public Limit<AACon> getLimit(String presetName) {\r
-               if (limits == null) {\r
-                       limits = getLimits();\r
-               }\r
-               Limit<AACon> limit = null;\r
-               if (limits != null) {\r
-                       // this returns default limit if preset is undefined!\r
-                       limit = limits.getLimitByName(presetName);\r
-               }\r
-               // If limit is not defined for a particular preset, then return default\r
-               // limit\r
-               if (limit == null) {\r
-                       log.debug("Limit for the preset " + presetName\r
-                                       + " is not found. Using default");\r
-                       limit = limits.getDefaultLimit();\r
-               }\r
-               return limit;\r
-       }\r
-\r
-       @Override\r
-       public LimitsManager<AACon> getLimits() {\r
-               // synchronise on static field\r
-               synchronized (log) {\r
-                       if (limits == null) {\r
-                               limits = Util.getLimits(this.getClass());\r
-                       }\r
-               }\r
-               return limits;\r
-       }\r
-\r
-       @Override\r
-       public Class<? extends Executable<?>> getType() {\r
-               return this.getClass();\r
+       public Class<AACon> getType() {\r
+               return (Class<AACon>) this.getClass();\r
        }\r
 \r
        public static String getStatFile() {\r