Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightMinMaxFacet.java @ 8964:45f1ad66560e
Code cleanup concerning calculations: improved error handling; improved interpolation; bed heights are now always used for spatial discretisation
author | gernotbelger |
---|---|
date | Thu, 29 Mar 2018 15:48:17 +0200 |
parents | 8a1c6e2ad48b |
children |
comparison
equal
deleted
inserted
replaced
8963:b98fbd91f64a | 8964:45f1ad66560e |
---|---|
17 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; | 17 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; |
18 import org.dive4elements.river.artifacts.model.FacetTypes; | 18 import org.dive4elements.river.artifacts.model.FacetTypes; |
19 import org.dive4elements.river.artifacts.resources.Resources; | 19 import org.dive4elements.river.artifacts.resources.Resources; |
20 import org.dive4elements.river.model.BedHeight; | 20 import org.dive4elements.river.model.BedHeight; |
21 import org.dive4elements.river.model.BedHeightValue; | 21 import org.dive4elements.river.model.BedHeightValue; |
22 import org.dive4elements.river.model.BedHeightValueType; | |
22 | 23 |
23 import gnu.trove.TDoubleArrayList; | 24 import gnu.trove.TDoubleArrayList; |
24 | 25 |
25 /** | 26 /** |
26 * More or less the same as {@link BedHeightFacet}, but was necessary to copy because else we break the old | 27 * More or less the same as {@link BedHeightFacet}, but was necessary to copy because else we break the old |
29 * @author Gernot Belger | 30 * @author Gernot Belger |
30 */ | 31 */ |
31 public class BedHeightMinMaxFacet extends BlackboardDataFacet implements FacetTypes { | 32 public class BedHeightMinMaxFacet extends BlackboardDataFacet implements FacetTypes { |
32 | 33 |
33 private static final long serialVersionUID = 1L; | 34 private static final long serialVersionUID = 1L; |
34 | |
35 public static enum BedHeightValueType { | |
36 min { | |
37 @Override | |
38 public Double getValue(final BedHeightValue bedheightValue) { | |
39 return bedheightValue.getMinHeight(); | |
40 } | |
41 }, | |
42 max { | |
43 @Override | |
44 public Double getValue(final BedHeightValue bedheightValue) { | |
45 return bedheightValue.getMaxHeight(); | |
46 } | |
47 }, | |
48 value { | |
49 @Override | |
50 public Double getValue(final BedHeightValue bedheightValue) { | |
51 return bedheightValue.getHeight(); | |
52 } | |
53 }; | |
54 | |
55 public abstract Double getValue(final BedHeightValue bedheightValue); | |
56 } | |
57 | 35 |
58 private final BedHeightValueType valueType; | 36 private final BedHeightValueType valueType; |
59 | 37 |
60 public BedHeightMinMaxFacet(final String name, final String description, final BedHeightValueType valueType) { | 38 public BedHeightMinMaxFacet(final String name, final String description, final BedHeightValueType valueType) { |
61 super(0, name, description); | 39 super(0, name, description); |