Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQResult.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQResult.java@bd047b71ab37 |
children | 4897a58c8746 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQResult.java Thu Apr 25 15:23:37 2013 +0200 @@ -0,0 +1,60 @@ +package org.dive4elements.river.artifacts.model.sq; + +import java.io.Serializable; + + + +public class SQResult implements Serializable { + + public static final int NUMBER_FRACTIONS = 6; + + public static final int FRACTION_A = 0; + public static final int FRACTION_B = 1; + public static final int FRACTION_C = 2; + public static final int FRACTION_D = 3; + public static final int FRACTION_E = 4; + public static final int FRACTION_F = 5; + + protected double km; + protected SQFractionResult[] fractions; + + public SQResult() { + this(0d, new SQFractionResult[NUMBER_FRACTIONS]); + } + + public SQResult(double km, SQFractionResult [] fractions) { + this.km = km; + this.fractions = fractions; + } + + public SQFractionResult getFraction(int idx) { + return idx >= 0 && idx < fractions.length + ? fractions[idx] + : null; + } + + public void setFraction(int idx, SQFractionResult fraction) { + if (idx >= 0 && idx < fractions.length) { + this.fractions[idx] = fraction; + } + } + + public static final String [] FRACTION_NAMES = { + "A", "B", "C", "D", "E", "F" + }; + + public String getFractionName(int idx) { + return idx >= 0 && idx < FRACTION_NAMES.length + ? FRACTION_NAMES[idx] + : ""; + } + + public double getKm() { + return km; + } + + public void setKm(double km) { + this.km = km; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :