Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/util/BedHeightInfo.java @ 9573:b9c87bbff6a4
mean bed height -> mean bed LEVEL
author | gernotbelger |
---|---|
date | Tue, 06 Nov 2018 10:56:22 +0100 |
parents | 6a1580b38e7d |
children |
rev | line source |
---|---|
8877 | 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 */ | |
8894 | 10 package org.dive4elements.river.artifacts.sinfo.util; |
8877 | 11 |
8884 | 12 import java.io.Serializable; |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
13 import java.math.BigDecimal; |
8884 | 14 |
8877 | 15 import org.dive4elements.river.model.BedHeight; |
16 | |
17 /** | |
18 * Basic infos about a {@link BedHeight}. | |
19 * | |
20 * @author Gernot Belger | |
21 */ | |
8894 | 22 public final class BedHeightInfo implements Serializable { |
8884 | 23 |
24 private static final long serialVersionUID = 1L; | |
8877 | 25 |
8946
5d5d482da3e9
Implementing SINFO - FlowDepthMinMax calculation
gernotbelger
parents:
8942
diff
changeset
|
26 private final int year; |
8877 | 27 |
28 private final String description; | |
29 | |
30 private final String type; | |
31 | |
8882 | 32 private final String evaluationBy; |
33 | |
8877 | 34 private final String locationSystem; |
35 | |
8879 | 36 private final String curElevationModelUnit; |
8877 | 37 |
8879 | 38 private final String oldElevationModelUnit; |
8877 | 39 |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
40 private final BigDecimal from; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
41 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
42 private final BigDecimal to; |
8882 | 43 |
8877 | 44 public static BedHeightInfo from(final BedHeight bedHeight) { |
45 return new BedHeightInfo(bedHeight); | |
46 } | |
47 | |
48 private BedHeightInfo(final BedHeight bedHeight) { | |
9230
6a1580b38e7d
Using a bed height without year in tkh calculation now throws an immediate error
gernotbelger
parents:
8946
diff
changeset
|
49 final Integer bhYear = bedHeight.getYear(); |
6a1580b38e7d
Using a bed height without year in tkh calculation now throws an immediate error
gernotbelger
parents:
8946
diff
changeset
|
50 if (bhYear == null) { |
9573 | 51 // REMARK: this should never happen, as we do not allow the user to select bed levels without a year information |
9230
6a1580b38e7d
Using a bed height without year in tkh calculation now throws an immediate error
gernotbelger
parents:
8946
diff
changeset
|
52 throw new IllegalArgumentException("bedHeight has no year"); |
6a1580b38e7d
Using a bed height without year in tkh calculation now throws an immediate error
gernotbelger
parents:
8946
diff
changeset
|
53 } |
6a1580b38e7d
Using a bed height without year in tkh calculation now throws an immediate error
gernotbelger
parents:
8946
diff
changeset
|
54 |
6a1580b38e7d
Using a bed height without year in tkh calculation now throws an immediate error
gernotbelger
parents:
8946
diff
changeset
|
55 this.year = bhYear; |
8877 | 56 this.description = bedHeight.getDescription(); |
57 this.type = bedHeight.getType().getName(); | |
8882 | 58 this.evaluationBy = bedHeight.getEvaluationBy(); |
8877 | 59 this.locationSystem = bedHeight.getLocationSystem().getName(); |
8879 | 60 this.curElevationModelUnit = bedHeight.getCurElevationModel().getUnit().getName(); |
61 this.oldElevationModelUnit = bedHeight.getCurElevationModel().getUnit().getName(); | |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
62 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
63 this.from = bedHeight.getRange().getA(); |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
64 this.to = bedHeight.getRange().getB(); |
8877 | 65 } |
66 | |
8946
5d5d482da3e9
Implementing SINFO - FlowDepthMinMax calculation
gernotbelger
parents:
8942
diff
changeset
|
67 public int getYear() { |
8877 | 68 return this.year; |
69 } | |
70 | |
71 public String getDescription() { | |
72 return this.description; | |
73 } | |
74 | |
75 public String getType() { | |
76 return this.type; | |
77 } | |
78 | |
8882 | 79 public String getEvaluationBy() { |
80 return this.evaluationBy; | |
81 } | |
82 | |
8877 | 83 public String getLocationSystem() { |
84 return this.locationSystem; | |
85 } | |
86 | |
8879 | 87 public String getCurElevationModelUnit() { |
88 return this.curElevationModelUnit; | |
8877 | 89 } |
90 | |
8879 | 91 public String getOldElevationModelUnit() { |
92 return this.oldElevationModelUnit; | |
8877 | 93 } |
8942
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
94 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
95 public BigDecimal getFrom() { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
96 return this.from; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
97 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
98 |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
99 public BigDecimal getTo() { |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
100 return this.to; |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
101 } |
11bf13cf0463
Minor changes to tkh calculation. Loading default bed heights form config file.
gernotbelger
parents:
8894
diff
changeset
|
102 } |