More work on AAConWS not finished yet!
[jabaws.git] / datamodel / compbio / data / sequence / MultiAnnotatedSequence.java
index 1a889e3..d5942b3 100644 (file)
@@ -1,9 +1,13 @@
 package compbio.data.sequence;\r
 \r
+import java.util.ArrayList;\r
 import java.util.EnumMap;\r
 import java.util.List;\r
 import java.util.Map;\r
 \r
+import javax.xml.bind.annotation.XmlAccessType;\r
+import javax.xml.bind.annotation.XmlAccessorType;\r
+\r
 import compbio.util.annotation.NotThreadSafe;\r
 \r
 /**\r
@@ -15,15 +19,20 @@ import compbio.util.annotation.NotThreadSafe;
  *            enum type\r
  */\r
 @NotThreadSafe\r
+@XmlAccessorType(XmlAccessType.FIELD)\r
 public class MultiAnnotatedSequence<T extends Enum<T>> {\r
 \r
-       private final Map<T, List<Float>> annotations;\r
+       private EnumMap<T, ArrayList<Float>> annotations;\r
+\r
+       MultiAnnotatedSequence() {\r
+               // default constructor for JAXB\r
+       }\r
 \r
        public MultiAnnotatedSequence(Class<T> enumeration) {\r
-               this.annotations = new EnumMap<T, List<Float>>(enumeration);\r
+               this.annotations = new EnumMap<T, ArrayList<Float>>(enumeration);\r
        }\r
 \r
-       public void addAnnotation(T type, List<Float> annotation) {\r
+       public void addAnnotation(T type, ArrayList<Float> annotation) {\r
                assert type != null : "Type is expected";\r
                assert annotation != null : "Not empty value is expected!";\r
                if (!annotations.isEmpty()) {\r
@@ -66,7 +75,7 @@ public class MultiAnnotatedSequence<T extends Enum<T>> {
        @Override\r
        public String toString() {\r
                String value = "";\r
-               for (Map.Entry<T, List<Float>> annt : annotations.entrySet()) {\r
+               for (Map.Entry<T, ArrayList<Float>> annt : annotations.entrySet()) {\r
                        value += annt.getKey() + " ";\r
                        value += annt.getValue() + "\n";\r
                }\r