annotate backend/src/main/java/org/dive4elements/river/model/BedHeightValueType.java @ 9444:ecadc9ed0ba0

Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
author mschaefer
date Tue, 21 Aug 2018 13:41:18 +0200
parents 45f1ad66560e
children d116a791b1f8
rev   line source
8964
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
2 * Software engineering by
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
3 * Björnsen Beratende Ingenieure GmbH
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
5 *
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
6 * This file is Free Software under the GNU AGPL (>=v3)
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
8 * documentation coming with Dive4Elements River for details.
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
9 */
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
10 package org.dive4elements.river.model;
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
11
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
12 /**
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
13 * Enumerations that allows to access min/max/mean value of {@link BedHeight} in the same way.
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
14 *
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
15 * @author Gernot Belger
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
16 *
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
17 */
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
18 public enum BedHeightValueType {
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
19 min {
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
20 @Override
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
21 public Double getValue(final BedHeightValue bedheightValue) {
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
22 return bedheightValue.getMinHeight();
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
23 }
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
24 },
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
25 max {
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
26 @Override
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
27 public Double getValue(final BedHeightValue bedheightValue) {
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
28 return bedheightValue.getMaxHeight();
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
29 }
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
30 },
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
31 value {
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
32 @Override
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
33 public Double getValue(final BedHeightValue bedheightValue) {
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
34 return bedheightValue.getHeight();
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
35 }
9444
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
36 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
37 field01 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
38 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
39 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
40 return bedheightValue.getHeight01();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
41 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
42 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
43 field02 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
44 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
45 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
46 return bedheightValue.getHeight02();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
47 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
48 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
49 field03 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
50 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
51 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
52 return bedheightValue.getHeight03();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
53 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
54 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
55 field04 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
56 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
57 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
58 return bedheightValue.getHeight04();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
59 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
60 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
61 field05 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
62 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
63 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
64 return bedheightValue.getHeight05();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
65 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
66 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
67 field06 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
68 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
69 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
70 return bedheightValue.getHeight06();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
71 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
72 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
73 field07 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
74 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
75 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
76 return bedheightValue.getHeight07();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
77 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
78 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
79 field08 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
80 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
81 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
82 return bedheightValue.getHeight08();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
83 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
84 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
85 field09 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
86 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
87 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
88 return bedheightValue.getHeight09();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
89 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
90 },
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
91 field10 {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
92 @Override
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
93 public Double getValue(final BedHeightValue bedheightValue) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
94 return bedheightValue.getHeight10();
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
95 }
8964
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
96 };
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
97
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
98 public abstract Double getValue(final BedHeightValue bedheightValue);
9444
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
99
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
100 /**
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
101 * Enum constant of a section height
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
102 *
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
103 * @param index
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
104 * 1-based section index
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
105 */
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
106 public static BedHeightValueType field(final int index) {
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
107 return valueOf(String.format("field%02d", index));
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
108 }
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
109
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
110 public static final int FIELD_FIRST_INDEX = 1;
ecadc9ed0ba0 Added heights and depths of cross section fields in the bundu bzws calculation and longitudinal section charts
mschaefer
parents: 8964
diff changeset
111 public static final int FIELD_LAST_INDEX = 10;
8964
45f1ad66560e Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
gernotbelger
parents:
diff changeset
112 }

http://dive4elements.wald.intevation.org