comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java @ 8169:856701739443

Handle missing years in bed height differences without assuming an unknown year to be BC 1.
author "Tom Gottfried <tom@intevation.de>"
date Mon, 01 Sep 2014 09:43:55 +0200
parents 76b5add4f268
children 5c3b36b519d0
comparison
equal deleted inserted replaced
8168:75a6ac0c73ef 8169:856701739443
13 13
14 /** Result of a bed diff year calculation. */ 14 /** Result of a bed diff year calculation. */
15 public class BedDiffYearResult 15 public class BedDiffYearResult
16 extends BedDifferencesResult 16 extends BedDifferencesResult
17 { 17 {
18 protected TDoubleArrayList bedHeights; 18 protected TDoubleArrayList diffsPerYear;
19 protected TDoubleArrayList dataGap; 19 protected TDoubleArrayList dataGap;
20 protected TDoubleArrayList soundingWidth; 20 protected TDoubleArrayList soundingWidth;
21 protected TDoubleArrayList morphWidth1; 21 protected TDoubleArrayList morphWidth1;
22 protected TDoubleArrayList morphWidth2; 22 protected TDoubleArrayList morphWidth2;
23 protected int start; 23 protected Integer start;
24 protected int end; 24 protected Integer end;
25 protected String nameFirst; 25 protected String nameFirst;
26 protected String nameSecond; 26 protected String nameSecond;
27 27
28 public BedDiffYearResult () { 28 public BedDiffYearResult () {
29 super(); 29 super();
30 this.bedHeights = new TDoubleArrayList(); 30 this.diffsPerYear = new TDoubleArrayList();
31 this.dataGap = new TDoubleArrayList(); 31 this.dataGap = new TDoubleArrayList();
32 this.soundingWidth = new TDoubleArrayList(); 32 this.soundingWidth = new TDoubleArrayList();
33 this.morphWidth1 = new TDoubleArrayList(); 33 this.morphWidth1 = new TDoubleArrayList();
34 this.morphWidth2 = new TDoubleArrayList(); 34 this.morphWidth2 = new TDoubleArrayList();
35 this.start = -1;
36 this.end = -1;
37 } 35 }
38 36
39 /** 37 /**
40 * @param kms the stations the following parameters are connected to. 38 * @param kms the stations the following parameters are connected to.
41 * @param differences the height differences 39 * @param differences the height differences
42 * @param heights1 the heights 40 * @param heights1 the heights
43 * @param heights2 the other heights 41 * @param heights2 the other heights
44 * @param bedHeights the differences normalized per year in m. 42 * @param diffsPerYear the differences normalized per year in cm.
45 */ 43 */
46 public BedDiffYearResult( 44 public BedDiffYearResult(
47 TDoubleArrayList kms, 45 TDoubleArrayList kms,
48 TDoubleArrayList differences, 46 TDoubleArrayList differences,
49 TDoubleArrayList heights1, 47 TDoubleArrayList heights1,
50 TDoubleArrayList heights2, 48 TDoubleArrayList heights2,
51 TDoubleArrayList morphWidth1, 49 TDoubleArrayList morphWidth1,
52 TDoubleArrayList morphWidth2, 50 TDoubleArrayList morphWidth2,
53 TDoubleArrayList soundingWidth, 51 TDoubleArrayList soundingWidth,
54 TDoubleArrayList bedHeights, 52 TDoubleArrayList diffsPerYear,
55 TDoubleArrayList dataGap, 53 TDoubleArrayList dataGap,
56 int start, 54 Integer start,
57 int end, 55 Integer end,
58 String nameFirst, 56 String nameFirst,
59 String nameSecond 57 String nameSecond
60 ) { 58 ) {
61 super(kms, differences, heights1, heights2); 59 super(kms, differences, heights1, heights2);
62 this.bedHeights = bedHeights; 60 this.diffsPerYear = diffsPerYear;
63 this.dataGap = dataGap; 61 this.dataGap = dataGap;
64 this.soundingWidth = soundingWidth; 62 this.soundingWidth = soundingWidth;
65 this.morphWidth1 = morphWidth1; 63 this.morphWidth1 = morphWidth1;
66 this.morphWidth2 = morphWidth2; 64 this.morphWidth2 = morphWidth2;
67 this.start = start; 65 this.start = start;
69 this.nameFirst = nameFirst; 67 this.nameFirst = nameFirst;
70 this.nameSecond = nameSecond; 68 this.nameSecond = nameSecond;
71 } 69 }
72 70
73 public TDoubleArrayList getBedHeights() { 71 public TDoubleArrayList getBedHeights() {
74 return this.bedHeights; 72 return this.diffsPerYear;
75 } 73 }
76 74
77 public TDoubleArrayList getDataGap() { 75 public TDoubleArrayList getDataGap() {
78 return this.dataGap; 76 return this.dataGap;
79 } 77 }
88 86
89 public TDoubleArrayList getSoundingWidth() { 87 public TDoubleArrayList getSoundingWidth() {
90 return this.soundingWidth; 88 return this.soundingWidth;
91 } 89 }
92 90
93 public int getStart() { 91 public Integer getStart() {
94 return this.start; 92 return this.start;
95 } 93 }
96 94
97 public void setStart(int value) { 95 public void setStart(int value) {
98 this.start = value; 96 this.start = value;
100 98
101 public void setEnd(int value) { 99 public void setEnd(int value) {
102 this.end = value; 100 this.end = value;
103 } 101 }
104 102
105 public int getEnd() { 103 public Integer getEnd() {
106 return this.end; 104 return this.end;
107 } 105 }
108 106
109 /** Get name of the first BedHeight (minuend). */ 107 /** Get name of the first BedHeight (minuend). */
110 public String getNameFirst() { 108 public String getNameFirst() {
127 public void addSoundingWidth(double value) { 125 public void addSoundingWidth(double value) {
128 this.soundingWidth.add(value); 126 this.soundingWidth.add(value);
129 } 127 }
130 128
131 public void addBedHeights(double value) { 129 public void addBedHeights(double value) {
132 this.bedHeights.add(value); 130 this.diffsPerYear.add(value);
133 } 131 }
134 132
135 public double[][] getMorphWidth1Data() { 133 public double[][] getMorphWidth1Data() {
136 return new double[][] { 134 return new double[][] {
137 kms.toNativeArray(), 135 kms.toNativeArray(),
154 } 152 }
155 153
156 public double[][] getHeightPerYearData() { 154 public double[][] getHeightPerYearData() {
157 return new double[][] { 155 return new double[][] {
158 kms.toNativeArray(), 156 kms.toNativeArray(),
159 bedHeights.toNativeArray() 157 diffsPerYear.toNativeArray()
160 }; 158 };
161 } 159 }
162 160
163 @Override 161 @Override
164 public String getDiffDescription() { 162 public String getDiffDescription() {

http://dive4elements.wald.intevation.org