Finally, the new web services are working
[jabaws.git] / datamodel / compbio / data / sequence / Score.java
index b61c74e..f28bd0d 100644 (file)
@@ -12,8 +12,6 @@ import java.util.TreeSet;
 \r
 import javax.xml.bind.annotation.XmlAccessType;\r
 import javax.xml.bind.annotation.XmlAccessorType;\r
-import javax.xml.bind.annotation.XmlElement;\r
-import javax.xml.bind.annotation.XmlTransient;\r
 \r
 import compbio.util.annotation.Immutable;\r
 \r
@@ -28,25 +26,22 @@ import compbio.util.annotation.Immutable;
 @Immutable\r
 public class Score {\r
 \r
-       @XmlTransient\r
        static final NumberFormat NUMBER_FORMAT = NumberFormat\r
                        .getNumberInstance(Locale.UK);\r
        static {\r
                NUMBER_FORMAT.setGroupingUsed(false);\r
                NUMBER_FORMAT.setMaximumFractionDigits(3);\r
        }\r
+       // This should be Enum<?> but JAXB cannot serialize it.\r
+       private final String method;\r
 \r
-       private Enum<?> method;\r
-       // private String method;\r
-\r
-       @XmlElement\r
        private TreeSet<Range> ranges = new TreeSet<Range>();\r
 \r
-       @XmlElement\r
        private ArrayList<Float> scores = new ArrayList<Float>(0);\r
 \r
        private Score() {\r
                // JaXB default constructor\r
+               method = null;\r
        }\r
 \r
        /**\r
@@ -60,7 +55,7 @@ public class Score {
         *            alignment\r
         */\r
        public Score(Enum<?> method, ArrayList<Float> scores) {\r
-               this.method = method;\r
+               this.method = method.toString();\r
                this.scores = new ArrayList<Float>(scores);\r
        }\r
 \r
@@ -76,18 +71,18 @@ public class Score {
         *            function, usually can be calculated based on scores\r
         */\r
        public Score(Enum<?> method, ArrayList<Float> scores, TreeSet<Range> ranges) {\r
-               this.method = method;\r
+               this.method = method.toString();\r
                this.ranges = ranges;\r
                this.scores = scores;\r
        }\r
 \r
        public Score(Enum<?> method, TreeSet<Range> ranges) {\r
-               this.method = method;\r
+               this.method = method.toString();\r
                this.ranges = ranges;\r
        }\r
 \r
        public Score(Enum<?> method, float[] scores) {\r
-               this.method = method;\r
+               this.method = method.toString();\r
                this.scores = toList(scores);\r
        }\r
 \r
@@ -103,7 +98,7 @@ public class Score {
         * \r
         * @return the ConservationMethod\r
         */\r
-       public Enum<?> getMethod() {\r
+       public String getMethod() {\r
                return method;\r
        }\r
 \r