Finally, the new web services are working
[jabaws.git] / datamodel / compbio / data / sequence / ScoreManager.java
index f384308..7ddf894 100644 (file)
@@ -13,10 +13,12 @@ import java.util.Set;
 \r
 import javax.xml.bind.annotation.XmlAccessType;\r
 import javax.xml.bind.annotation.XmlAccessorType;\r
+import javax.xml.bind.annotation.XmlTransient;\r
 \r
 @XmlAccessorType(XmlAccessType.FIELD)\r
 public class ScoreManager {\r
 \r
+       @XmlTransient\r
        public static final String SINGLE_ENTRY_KEY = "Alignment";\r
 \r
        private List<ScoreHolder> seqScores;\r
@@ -104,7 +106,6 @@ public class ScoreManager {
                }\r
                writer.flush();\r
        }\r
-       \r
 \r
        @Override\r
        public int hashCode() {\r
@@ -132,13 +133,11 @@ public class ScoreManager {
                return true;\r
        }\r
 \r
-\r
-\r
        @XmlAccessorType(XmlAccessType.FIELD)\r
        public static class ScoreHolder {\r
 \r
                public String id;\r
-               public Set<Score> scores;\r
+               public HashSet<Score> scores;\r
 \r
                private ScoreHolder() {\r
                        // JAXB Default constructor should not be used otherwise\r
@@ -146,7 +145,7 @@ public class ScoreManager {
 \r
                ScoreHolder(String id, Set<Score> scores) {\r
                        this.id = id;\r
-                       this.scores = scores;\r
+                       this.scores = new HashSet<Score>(scores);\r
                }\r
 \r
                public void writeOut(OutputStream outStream) throws IOException {\r
@@ -158,13 +157,12 @@ public class ScoreManager {
 \r
                public Score getScoreByMethod(Enum<?> method) {\r
                        for (Score sc : scores) {\r
-                               if (method == sc.getMethod()) {\r
+                               if (method.toString().equals(sc.getMethod())) {\r
                                        return sc;\r
                                }\r
                        }\r
                        return null;\r
                }\r
-\r
                public int getNumberOfScores() {\r
                        return scores.size();\r
                }\r
@@ -200,7 +198,6 @@ public class ScoreManager {
                                return false;\r
                        return true;\r
                }\r
-               \r
-               \r
+\r
        }\r
 }\r