Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java @ 7262:7bf8ebdcc4ac
RangeAccess: Use min/max as from/to in RangeAccess.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 08 Oct 2013 15:23:51 +0200 |
parents | 1f38656b68c4 |
children | e4606eae8ea5 |
comparison
equal
deleted
inserted
replaced
7261:a56fe3bc6700 | 7262:7bf8ebdcc4ac |
---|---|
120 public boolean hasTo() { | 120 public boolean hasTo() { |
121 return to != null || (to = getDouble("ld_to")) != null; | 121 return to != null || (to = getDouble("ld_to")) != null; |
122 } | 122 } |
123 | 123 |
124 | 124 |
125 /** Return ld_from data (in km). */ | 125 /** Return ld_from data (in km). If not found, the min. */ |
126 public double getFrom() { | 126 public double getFrom() { |
127 if (from == null) { | 127 if (from == null) { |
128 from = getDouble("ld_from"); | 128 from = getDouble("ld_from"); |
129 } | 129 } |
130 | 130 |
131 if (logger.isDebugEnabled()) { | 131 if (logger.isDebugEnabled()) { |
132 logger.debug("from: '" + from + "'"); | 132 logger.debug("from from data: '" + from + "'"); |
133 } | |
134 | |
135 if (from == null) { | |
136 logger.warn("No 'from' found. assume max of river."); | |
137 return getRiver().determineMinMaxDistance()[0]; | |
133 } | 138 } |
134 | 139 |
135 return from.doubleValue(); | 140 return from.doubleValue(); |
136 } | 141 } |
137 | 142 |
138 | 143 |
139 /** Return ld_to data (in km). */ | 144 /** Return ld_to data (in km), if not found, the max. */ |
140 public double getTo() { | 145 public double getTo() { |
141 if (to == null) { | 146 if (to == null) { |
142 to = getDouble("ld_to"); | 147 to = getDouble("ld_to"); |
143 } | 148 } |
144 | 149 |
145 if (logger.isDebugEnabled()) { | 150 if (logger.isDebugEnabled()) { |
146 logger.debug("to: '" + to + "'"); | 151 logger.debug("to from data: '" + to + "'"); |
152 } | |
153 | |
154 if (to == null) { | |
155 logger.warn("No 'to' found. assume max of river."); | |
156 return getRiver().determineMinMaxDistance()[1]; | |
147 } | 157 } |
148 | 158 |
149 return to.doubleValue(); | 159 return to.doubleValue(); |
150 } | 160 } |
151 | 161 |