Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionAccess.java @ 9074:766890addcb2
state To client communication;
author | gernotbelger |
---|---|
date | Fri, 18 May 2018 17:26:26 +0200 |
parents | 611a523fc42f |
children | 9b4f5e61c02e |
rev | line source |
---|---|
9067 | 1 /* Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 | |
11 package org.dive4elements.river.artifacts.sinfo.collision; | |
12 | |
13 import org.dive4elements.river.artifacts.access.RangeAccess; | |
9070
611a523fc42f
VegetationZoneAccessHelper, VegetationTablePanels verbessert
gernotbelger
parents:
9069
diff
changeset
|
14 import org.dive4elements.river.artifacts.common.EpochYearAccessHelper; |
9067 | 15 import org.dive4elements.river.artifacts.sinfo.SINFOArtifact; |
16 import org.dive4elements.river.artifacts.sinfo.SinfoCalcMode; | |
17 | |
18 /** | |
19 * Access to the flow depth calculation type specific SInfo artifact data. | |
20 * REMARK: this class is NOT intended to be hold in the results (or anywhere else), in order to avoid a permanent | |
21 * reference to the artifact instance. | |
22 * Hence we do NOT cache any data. | |
23 * | |
24 * @author Gernot Belger | |
25 */ | |
9074 | 26 final public class CollisionAccess extends RangeAccess { |
9067 | 27 |
9070
611a523fc42f
VegetationZoneAccessHelper, VegetationTablePanels verbessert
gernotbelger
parents:
9069
diff
changeset
|
28 private final EpochYearAccessHelper helper; |
9067 | 29 |
30 /// Fields from state: | |
31 | |
32 // calculation_mode (String), sollte sinfo_calc_collision sein | |
33 // ld_from, ld_to | |
34 // ye_select (String), mögliche werte: "state.sinfo.epoch" "state.sinfo.year" | |
35 // years (String) | |
36 // epochs (String) | |
37 | |
38 public CollisionAccess(final SINFOArtifact artifact) { | |
39 super(artifact); | |
40 | |
41 /* assert calculation mode */ | |
42 final SinfoCalcMode calculationMode = artifact.getCalculationMode(); | |
9070
611a523fc42f
VegetationZoneAccessHelper, VegetationTablePanels verbessert
gernotbelger
parents:
9069
diff
changeset
|
43 this.helper = new EpochYearAccessHelper(artifact); |
9067 | 44 assert (calculationMode == SinfoCalcMode.sinfo_calc_flow_depth); |
45 } | |
46 | |
47 public int[] getYears() { | |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
9067
diff
changeset
|
48 return this.helper.getYears("state.sinfo.year", "years"); |
9067 | 49 } |
50 | |
51 public int[][] getEpochs() { | |
9069
1ffd38826175
access uinfo.vegetationzones+inundation_duration
gernotbelger
parents:
9067
diff
changeset
|
52 return this.helper.getEpochs("state.sinfo.epoch", "epochs"); |
9067 | 53 } |
54 | |
55 } |