Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java @ 8568:078b07a94023
Use updated class name instead of no more existant.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Thu, 26 Feb 2015 15:37:03 +0100 |
parents | 76113b975829 |
children | 1f6b30310360 |
comparison
equal
deleted
inserted
replaced
8567:9bbce0edd36b | 8568:078b07a94023 |
---|---|
40 double fromKm = access.getFrom(); | 40 double fromKm = access.getFrom(); |
41 double toKm = access.getTo(); | 41 double toKm = access.getTo(); |
42 | 42 |
43 BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length]; | 43 BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length]; |
44 for (int i = 0; i < heightIds.length; i++) { | 44 for (int i = 0; i < heightIds.length; i++) { |
45 BedHeightSingleData [] pair = getHeightPair(heightIds[i], fromKm, toKm); | 45 BedHeightData [] pair = getHeightPair(heightIds[i], fromKm, toKm); |
46 if (pair[0].getYear() == null || pair[1].getYear() == null) { | 46 if (pair[0].getYear() == null || pair[1].getYear() == null) { |
47 addProblem("beddiff.missing.year"); | 47 addProblem("beddiff.missing.year"); |
48 } | 48 } |
49 results[i] = calculateYearDifference(pair, heightIds[i]); | 49 results[i] = calculateYearDifference(pair, heightIds[i]); |
50 } | 50 } |
51 | 51 |
52 return new CalculationResult(results, this); | 52 return new CalculationResult(results, this); |
53 } | 53 } |
54 | 54 |
55 /** Get two BedHeights from factory. */ | 55 /** Get two BedHeights from factory. */ |
56 private static BedHeightSingleData [] getHeightPair(int [] ids, double from, double to) { | 56 private static BedHeightData [] getHeightPair(int [] ids, double from, double to) { |
57 return new BedHeightSingleData [] { | 57 return new BedHeightData [] { |
58 (BedHeightSingleData)BedHeightFactory.getHeight("single", ids[0], from, to), | 58 (BedHeightData)BedHeightFactory.getHeight("single", ids[0], from, to), |
59 (BedHeightSingleData)BedHeightFactory.getHeight("single", ids[1], from, to) | 59 (BedHeightData)BedHeightFactory.getHeight("single", ids[1], from, to) |
60 }; | 60 }; |
61 } | 61 } |
62 | 62 |
63 private BedDiffYearResult calculateYearDifference( | 63 private BedDiffYearResult calculateYearDifference( |
64 BedHeightSingleData[] pair, | 64 BedHeightData[] pair, |
65 int[] ids | 65 int[] ids |
66 ) { | 66 ) { |
67 log.debug("BedDiffCalculation.calculateYearDifference"); | 67 log.debug("BedDiffCalculation.calculateYearDifference"); |
68 BedHeightSingleData s1 = pair[0]; | 68 BedHeightData s1 = pair[0]; |
69 BedHeightSingleData s2 = pair[1]; | 69 BedHeightData s2 = pair[1]; |
70 | 70 |
71 TDoubleArrayList stations = s1.getStations(); | 71 TDoubleArrayList stations = s1.getStations(); |
72 int size = stations.size(); | 72 int size = stations.size(); |
73 | 73 |
74 TDoubleArrayList diffRes = new TDoubleArrayList(size); | 74 TDoubleArrayList diffRes = new TDoubleArrayList(size); |