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
* 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
@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