Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/WstValueTable.java @ 6923:254a3f3556ee
WstValueTable: Add method to find out wether the Qs are 'fake'
This happens in import process when no Q values are found (they are
set to zero). As consequence, these datasets can only be drawn
as markers to an axis.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 26 Aug 2013 15:32:57 +0200 |
parents | 0f0f09badd29 |
children | 7a7cb22395b4 |
comparison
equal
deleted
inserted
replaced
6922:6fb355b87f50 | 6923:254a3f3556ee |
---|---|
1273 } | 1273 } |
1274 return result; | 1274 return result; |
1275 } | 1275 } |
1276 | 1276 |
1277 | 1277 |
1278 /** True if no QRange is given or Q equals zero. */ | |
1279 public boolean hasEmptyQ() { | |
1280 for (Column column: columns) { | |
1281 if (column.getQRangeTree() == null) { | |
1282 return true; | |
1283 } | |
1284 else { | |
1285 if (Math.abs(column.getQRangeTree().maxQ()) <= 0.01d) { | |
1286 return true; | |
1287 } | |
1288 } | |
1289 } | |
1290 | |
1291 if (columns.length == 0) { | |
1292 log.warn("No columns in WstValueTable."); | |
1293 } | |
1294 | |
1295 return false; | |
1296 } | |
1297 | |
1298 | |
1278 /** Find ranges that are between km1 and km2 (inclusive?) */ | 1299 /** Find ranges that are between km1 and km2 (inclusive?) */ |
1279 public List<Range> findSegments(double km1, double km2) { | 1300 public List<Range> findSegments(double km1, double km2) { |
1280 return columns.length != 0 | 1301 return columns.length != 0 |
1281 ? columns[columns.length-1].getQRangeTree().findSegments(km1, km2) | 1302 ? columns[columns.length-1].getQRangeTree().findSegments(km1, km2) |
1282 : Collections.<Range>emptyList(); | 1303 : Collections.<Range>emptyList(); |