git://source.jalview.org
/
jabaws.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Further work on statistics display
[jabaws.git]
/
datamodel
/
compbio
/
data
/
sequence
/
Score.java
diff --git
a/datamodel/compbio/data/sequence/Score.java
b/datamodel/compbio/data/sequence/Score.java
index
39bb398
..
f28bd0d
100644
(file)
--- a/
datamodel/compbio/data/sequence/Score.java
+++ b/
datamodel/compbio/data/sequence/Score.java
@@
-6,11
+6,8
@@
import java.io.OutputStream;
import java.io.OutputStreamWriter;
\r
import java.text.NumberFormat;
\r
import java.util.ArrayList;
\r
import java.io.OutputStreamWriter;
\r
import java.text.NumberFormat;
\r
import java.util.ArrayList;
\r
-import java.util.Collections;
\r
-import java.util.List;
\r
import java.util.Locale;
\r
import java.util.Set;
\r
import java.util.Locale;
\r
import java.util.Set;
\r
-import java.util.SortedSet;
\r
import java.util.TreeSet;
\r
\r
import javax.xml.bind.annotation.XmlAccessType;
\r
import java.util.TreeSet;
\r
\r
import javax.xml.bind.annotation.XmlAccessType;
\r
@@
-35,15
+32,16
@@
public class Score {
NUMBER_FORMAT.setGroupingUsed(false);
\r
NUMBER_FORMAT.setMaximumFractionDigits(3);
\r
}
\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
\r
- private Enum<?> method;
\r
+ private TreeSet<Range> ranges = new TreeSet<Range>();
\r
\r
\r
- private SortedSet<Range> ranges = new TreeSet<Range>();
\r
-
\r
- private List<Float> scores = Collections.emptyList();
\r
+ private ArrayList<Float> scores = new ArrayList<Float>(0);
\r
\r
private Score() {
\r
// JaXB default constructor
\r
\r
private Score() {
\r
// JaXB default constructor
\r
+ method = null;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-56,8
+54,8
@@
public class Score {
* the actual conservation values for each column of the
\r
* alignment
\r
*/
\r
* the actual conservation values for each column of the
\r
* alignment
\r
*/
\r
- public Score(Enum<?> method, List<Float> scores) {
\r
- this.method = method;
\r
+ public Score(Enum<?> method, ArrayList<Float> scores) {
\r
+ this.method = method.toString();
\r
this.scores = new ArrayList<Float>(scores);
\r
}
\r
\r
this.scores = new ArrayList<Float>(scores);
\r
}
\r
\r
@@
-72,24
+70,24
@@
public class Score {
* The set of ranges i.e. parts of the sequence with specific
\r
* function, usually can be calculated based on scores
\r
*/
\r
* The set of ranges i.e. parts of the sequence with specific
\r
* function, usually can be calculated based on scores
\r
*/
\r
- public Score(Enum<?> method, List<Float> scores, SortedSet<Range> ranges) {
\r
- this.method = method;
\r
+ public Score(Enum<?> method, ArrayList<Float> scores, TreeSet<Range> ranges) {
\r
+ this.method = method.toString();
\r
this.ranges = ranges;
\r
this.scores = scores;
\r
}
\r
\r
this.ranges = ranges;
\r
this.scores = scores;
\r
}
\r
\r
- public Score(Enum<?> method, SortedSet<Range> ranges) {
\r
- this.method = method;
\r
+ public Score(Enum<?> method, TreeSet<Range> ranges) {
\r
+ this.method = method.toString();
\r
this.ranges = ranges;
\r
}
\r
\r
public Score(Enum<?> method, float[] scores) {
\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
this.scores = toList(scores);
\r
}
\r
\r
- private List<Float> toList(float[] values) {
\r
- List<Float> vlist = new ArrayList<Float>();
\r
+ private ArrayList<Float> toList(float[] values) {
\r
+ ArrayList<Float> vlist = new ArrayList<Float>();
\r
for (float v : values) {
\r
vlist.add(new Float(v));
\r
}
\r
for (float v : values) {
\r
vlist.add(new Float(v));
\r
}
\r
@@
-100,7
+98,7
@@
public class Score {
*
\r
* @return the ConservationMethod
\r
*/
\r
*
\r
* @return the ConservationMethod
\r
*/
\r
- public Enum<?> getMethod() {
\r
+ public String getMethod() {
\r
return method;
\r
}
\r
\r
return method;
\r
}
\r
\r
@@
-109,7
+107,7
@@
public class Score {
*
\r
* @return the column scores for the alignment
\r
*/
\r
*
\r
* @return the column scores for the alignment
\r
*/
\r
- public List<Float> getScores() {
\r
+ public ArrayList<Float> getScores() {
\r
return scores;
\r
}
\r
\r
return scores;
\r
}
\r
\r
@@
-118,11
+116,11
@@
public class Score {
*
\r
* @return
\r
*/
\r
*
\r
* @return
\r
*/
\r
- public SortedSet<Range> getRanges() {
\r
+ public TreeSet<Range> getRanges() {
\r
return ranges;
\r
}
\r
\r
return ranges;
\r
}
\r
\r
- public void setRanges(SortedSet<Range> ranges) {
\r
+ public void setRanges(TreeSet<Range> ranges) {
\r
this.ranges = ranges;
\r
}
\r
\r
this.ranges = ranges;
\r
}
\r
\r