# HG changeset patch # User Sascha L. Teichmann # Date 1340731231 0 # Node ID 49fe2ed03c12a749f91eecfa9cac74195507fdf0 # Parent 89dc2db3a2022a3c9c33427e0a006fdcb44b0ed7 SQ: Refactored fitting to better fit the data types of SQResult. flys-artifacts/trunk@4805 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 89dc2db3a202 -r 49fe2ed03c12 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Jun 26 17:06:26 2012 +0000 +++ b/flys-artifacts/ChangeLog Tue Jun 26 17:20:31 2012 +0000 @@ -1,3 +1,9 @@ +2012-06-26 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/sq/Outlier.java, + src/main/java/de/intevation/flys/artifacts/model/sq/Fitting.java: + Refactored to better fit the data types of SQResult. + 2012-06-26 Sascha L. Teichmann * src/main/java/de/intevation/flys/exports/LegendProcessor.java: diff -r 89dc2db3a202 -r 49fe2ed03c12 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Fitting.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Fitting.java Tue Jun 26 17:06:26 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Fitting.java Tue Jun 26 17:20:31 2012 +0000 @@ -28,9 +28,9 @@ protected double chiSqr; - protected List remaining; + protected SQ [] remaining; - protected List> outliers; + protected List outliers; public Fitting() { } @@ -80,19 +80,19 @@ this.chiSqr = chiSqr; } - public List getRemaining() { + public SQ [] getRemaining() { return remaining; } - public void setRemaining(List remaining) { + public void setRemaining(SQ [] remaining) { this.remaining = remaining; } - public List> getOutliers() { + public List getOutliers() { return outliers; } - public void setOutliers(List> outliers) { + public void setOutliers(List outliers) { this.outliers = outliers; } @@ -203,7 +203,14 @@ @Override public void finished() { - setOutliers(outliers); + List result = + new ArrayList(outliers.size()); + + for (List ols: outliers) { + result.add(ols.toArray(new SQ[ols.size()])); + } + + setOutliers(result); } }, sqs, diff -r 89dc2db3a202 -r 49fe2ed03c12 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Outlier.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Outlier.java Tue Jun 26 17:06:26 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/Outlier.java Tue Jun 26 17:20:31 2012 +0000 @@ -37,7 +37,7 @@ } } // class EvalSQ - public static List detectOutliers( + public static SQ [] detectOutliers( Callback callback, List sqs, double stdDevFactor @@ -91,10 +91,10 @@ callback.finished(); - List result = new ArrayList(good.size()); + SQ [] result = new SQ[good.size()]; - for (EvalSQ esq: good) { - result.add(esq.sq); + for (int i = 0; i < result.length; ++i) { + result[i] = good.get(i).sq; } return result;