comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/common/GaugeMainValueFinder.java @ 9206:b38be7ea53e2

Fixed approx char restaurated, findValue condition for zone name corrected
author mschaefer
date Mon, 02 Jul 2018 19:02:24 +0200
parents b4402594213b
children d9fda7af24ca
comparison
equal deleted inserted replaced
9204:4f411c6ee3ae 9206:b38be7ea53e2
36 36
37 private final NavigableMap<Double, MainValue> mainValues; 37 private final NavigableMap<Double, MainValue> mainValues;
38 38
39 private final MainValueTypeKey keyType; 39 private final MainValueTypeKey keyType;
40 40
41 private final String approxPrefix = "ca."; // "\u2248" geht wohl nicht 41 private final String approxPrefix = "\u2248";
42 42
43 private Entry<Double, MainValue> foundCeiling; 43 private Entry<Double, MainValue> foundCeiling;
44 44
45 private Entry<Double, MainValue> foundFloor; 45 private Entry<Double, MainValue> foundFloor;
46 46
85 /** 85 /**
86 * Searches the main value zone for a value, and returns a textual description of the zone 86 * Searches the main value zone for a value, and returns a textual description of the zone
87 * (name for an exact match, circa expression for +/- 10% match, less-than/between/greater-than expression otherwise) 87 * (name for an exact match, circa expression for +/- 10% match, less-than/between/greater-than expression otherwise)
88 */ 88 */
89 public String findZoneName(final double value) { 89 public String findZoneName(final double value) {
90 if (!this.findValue(value)) 90 this.findValue(value);
91 if (Double.isNaN(this.foundRelativeDistance))
91 return ""; 92 return "";
92 93
93 // Clearly below or just (max. 10%) below lowest named value 94 // Clearly below or just (max. 10%) below lowest named value
94 if (this.foundFloor == null) { 95 if (this.foundFloor == null) {
95 if (Double.isInfinite(this.foundRelativeDistance)) 96 if (Double.isInfinite(this.foundRelativeDistance))

http://dive4elements.wald.intevation.org