Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/common/AbstractCalculationResult.java @ 9425:3f49835a00c3
Extended CrossSectionFacet so it may fetch different data from within the artifact result.
Also allows to have acces to the potentially already computed artifact result via its normal computation cache.
author | gernotbelger |
---|---|
date | Fri, 17 Aug 2018 15:31:02 +0200 |
parents | e5367900dd6d |
children | aa6ee96071b7 |
comparison
equal
deleted
inserted
replaced
9424:da19f1f58d72 | 9425:3f49835a00c3 |
---|---|
50 | 50 |
51 public final double[][] getStationPoints(final IResultType yType) { | 51 public final double[][] getStationPoints(final IResultType yType) { |
52 return getPoints(GeneralResultType.station, yType, TruePredicate.INSTANCE); | 52 return getPoints(GeneralResultType.station, yType, TruePredicate.INSTANCE); |
53 } | 53 } |
54 | 54 |
55 /** | |
56 * Return the row with the given station (within the given tolerance) by linear search. | |
57 * Returns <code>null</code>, if no such station was found. | |
58 */ | |
59 protected final ResultRow getRowForStation(final double searchStation, final double stationTolerance) { | |
60 | |
61 for (final ResultRow row : this.rows) { | |
62 final double station = row.getDoubleValue(GeneralResultType.station); | |
63 if (Math.abs(station - searchStation) < stationTolerance) | |
64 return row; | |
65 } | |
66 | |
67 return null; | |
68 } | |
69 | |
55 public final double[][] getPoints(final IResultType typeX, final IResultType typeY, final Predicate rowFilter) { | 70 public final double[][] getPoints(final IResultType typeX, final IResultType typeY, final Predicate rowFilter) { |
56 | 71 |
57 final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); | 72 final TDoubleArrayList xPoints = new TDoubleArrayList(this.rows.size()); |
58 final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); | 73 final TDoubleArrayList yPoints = new TDoubleArrayList(this.rows.size()); |
59 | 74 |