Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCalculation.java @ 9006:7134a4c7d1b6
U-Info S-Info general work
author | gernotbelger |
---|---|
date | Tue, 17 Apr 2018 13:20:25 +0200 |
parents | fb9430250899 |
children | a5cf8d7bff3c |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCalculation.java Tue Apr 17 13:19:56 2018 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/uinfo/vegetationzones/VegetationZonesCalculation.java Tue Apr 17 13:20:25 2018 +0200 @@ -1,6 +1,6 @@ /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde - * Software engineering by - * Björnsen Beratende Ingenieure GmbH + * Software engineering by + * Björnsen Beratende Ingenieure GmbH * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * This file is Free Software under the GNU AGPL (>=v3) @@ -19,10 +19,10 @@ import org.dive4elements.river.artifacts.model.Calculation; import org.dive4elements.river.artifacts.model.CalculationResult; import org.dive4elements.river.artifacts.resources.Resources; -import org.dive4elements.river.artifacts.sinfo.common.SInfoResultType; import org.dive4elements.river.artifacts.sinfo.util.CalculationUtils; import org.dive4elements.river.artifacts.sinfo.util.RiverInfo; import org.dive4elements.river.artifacts.uinfo.UINFOArtifact; +import org.dive4elements.river.artifacts.uinfo.commons.UInfoResultType; import org.dive4elements.river.model.River; /** @@ -31,13 +31,13 @@ */ final class VegetationZonesCalculation { - private CallContext context; + private final CallContext context; - public VegetationZonesCalculation(CallContext context) { + public VegetationZonesCalculation(final CallContext context) { this.context = context; } - public CalculationResult calculate(UINFOArtifact uinfo) { + public CalculationResult calculate(final UINFOArtifact uinfo) { final Calculation problems = new Calculation(); final String calcModeLabel = Resources.getMsg(this.context.getMeta(), uinfo.getCalculationMode().name()); @@ -45,31 +45,24 @@ final RiverAccess access = new RiverAccess(uinfo); final River river = access.getRiver(); - DoubleRange calcRange = null; + final DoubleRange calcRange = null; final RiverInfo riverInfo = new RiverInfo(river); - + final VegetationZonesCalculationResults results = new VegetationZonesCalculationResults(calcModeLabel, user, riverInfo, calcRange); - final Collection<ResultRow> rows = new ArrayList<ResultRow>(); - - final ResultRow row1 = ResultRow.create(). // - putValue(SInfoResultType.discharge, 100). // - putValue(SInfoResultType.waterlevel, 2). // - putValue(SInfoResultType.gaugeLabel, "Torgau"); + final Collection<ResultRow> rows = new ArrayList<>(); - rows.add(row1); - - ResultRow row2 = ResultRow.create(). // - putValue(SInfoResultType.discharge, 200). // - putValue(SInfoResultType.waterlevel, 3). // - putValue(SInfoResultType.gaugeLabel, "Zollenspieker"); + final ResultRow row2 = ResultRow.create(). // + putValue(UInfoResultType.vegname, "Zonaler Wald"). // + putValue(UInfoResultType.vegdauervon, 0). // + putValue(UInfoResultType.vegdauerbis, 5); rows.add(row2); final VegetationZonesCalculationResult result = new VegetationZonesCalculationResult("Ergebnis 1", null, rows); - + results.addResult(result, problems); - + return new CalculationResult(results, problems); } } \ No newline at end of file