X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=datamodel%2Fcompbio%2Fdata%2Fsequence%2FScore.java;h=f28bd0d6a34934551efb015baaa8290939a63e28;hb=aca9c5503b812c9c96aebb408748dc15728f9ad7;hp=b61c74e4f17703a680c4279149a58ec34c3dc531;hpb=7e625752237ee07e815bfb28048bb0b1193b45c5;p=jabaws.git diff --git a/datamodel/compbio/data/sequence/Score.java b/datamodel/compbio/data/sequence/Score.java index b61c74e..f28bd0d 100644 --- a/datamodel/compbio/data/sequence/Score.java +++ b/datamodel/compbio/data/sequence/Score.java @@ -12,8 +12,6 @@ import java.util.TreeSet; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlTransient; import compbio.util.annotation.Immutable; @@ -28,25 +26,22 @@ import compbio.util.annotation.Immutable; @Immutable public class Score { - @XmlTransient static final NumberFormat NUMBER_FORMAT = NumberFormat .getNumberInstance(Locale.UK); static { NUMBER_FORMAT.setGroupingUsed(false); NUMBER_FORMAT.setMaximumFractionDigits(3); } + // This should be Enum but JAXB cannot serialize it. + private final String method; - private Enum method; - // private String method; - - @XmlElement private TreeSet ranges = new TreeSet(); - @XmlElement private ArrayList scores = new ArrayList(0); private Score() { // JaXB default constructor + method = null; } /** @@ -60,7 +55,7 @@ public class Score { * alignment */ public Score(Enum method, ArrayList scores) { - this.method = method; + this.method = method.toString(); this.scores = new ArrayList(scores); } @@ -76,18 +71,18 @@ public class Score { * function, usually can be calculated based on scores */ public Score(Enum method, ArrayList scores, TreeSet ranges) { - this.method = method; + this.method = method.toString(); this.ranges = ranges; this.scores = scores; } public Score(Enum method, TreeSet ranges) { - this.method = method; + this.method = method.toString(); this.ranges = ranges; } public Score(Enum method, float[] scores) { - this.method = method; + this.method = method.toString(); this.scores = toList(scores); } @@ -103,7 +98,7 @@ public class Score { * * @return the ConservationMethod */ - public Enum getMethod() { + public String getMethod() { return method; }