comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeight.java @ 3897:bce2dd4310a6

MINFO: Updated data fields to fit the needs of bedheight difference calculation. flys-artifacts/trunk@5560 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 21 Sep 2012 14:18:16 +0000
parents 633fbb61a0cc
children
comparison
equal deleted inserted replaced
3896:82109cea32d2 3897:bce2dd4310a6
10 { 10 {
11 private static Logger log = Logger.getLogger(BedHeight.class); 11 private static Logger log = Logger.getLogger(BedHeight.class);
12 12
13 protected TDoubleArrayList heights; 13 protected TDoubleArrayList heights;
14 protected TDoubleArrayList station; 14 protected TDoubleArrayList station;
15 protected TDoubleArrayList data_gap;
16 protected TDoubleArrayList morphWidth;
17 15
18 public BedHeight() { 16 public BedHeight() {
19 heights = new TDoubleArrayList(); 17 heights = new TDoubleArrayList();
20 station = new TDoubleArrayList(); 18 station = new TDoubleArrayList();
21 data_gap = new TDoubleArrayList();
22 morphWidth = new TDoubleArrayList();
23 } 19 }
24 20
25 public BedHeight(String name) { 21 public BedHeight(String name) {
26 super(name); 22 super(name);
27 heights = new TDoubleArrayList(); 23 heights = new TDoubleArrayList();
28 station = new TDoubleArrayList(); 24 station = new TDoubleArrayList();
29 data_gap = new TDoubleArrayList();
30 morphWidth = new TDoubleArrayList();
31 } 25 }
32 26
33 public BedHeight(int capacity) { 27 public BedHeight(int capacity) {
34 this(capacity, ""); 28 this(capacity, "");
35 } 29 }
36 30
37 public BedHeight(int capacity, String name) { 31 public BedHeight(int capacity, String name) {
38 super(name); 32 super(name);
39 heights = new TDoubleArrayList(capacity); 33 heights = new TDoubleArrayList(capacity);
40 station = new TDoubleArrayList(capacity); 34 station = new TDoubleArrayList(capacity);
41 data_gap = new TDoubleArrayList(capacity);
42 morphWidth = new TDoubleArrayList();
43 } 35 }
44 36
45 public void add(double value, double station, double gap, double width) { 37 public void add(double value, double station) {
46 this.heights.add(value); 38 this.heights.add(value);
47 this.station.add(station); 39 this.station.add(station);
48 this.data_gap.add(gap);
49 this.morphWidth.add(width);
50 } 40 }
51 41
52 public int size() { 42 public int size() {
53 return heights.size(); 43 return heights.size();
54 } 44 }
66 } 56 }
67 57
68 public double [] get(int idx, double [] dst) { 58 public double [] get(int idx, double [] dst) {
69 dst[0] = heights.getQuick(idx); 59 dst[0] = heights.getQuick(idx);
70 dst[1] = station.getQuick(idx); 60 dst[1] = station.getQuick(idx);
71 dst[2] = data_gap.getQuick(idx);
72 dst[3] = morphWidth.getQuick(idx);
73 return dst; 61 return dst;
74 } 62 }
75 63
76 public double getMorphWidth(int idx) { 64 public double minHeights() {
77 return this.morphWidth.get(idx);
78 }
79
80 public double getDataGap(int idx) {
81 return this.data_gap.get(idx);
82 }
83
84 public double minHeights() {
85 return heights.min(); 65 return heights.min();
86 } 66 }
87 67
88 public TDoubleArrayList getStations() { 68 public TDoubleArrayList getStations() {
89 return this.station; 69 return this.station;
93 if (this.station.indexOf(station) >= 0) { 73 if (this.station.indexOf(station) >= 0) {
94 return this.heights.get(this.station.indexOf(station)); 74 return this.heights.get(this.station.indexOf(station));
95 } 75 }
96 return Double.NaN; 76 return Double.NaN;
97 } 77 }
78
98 79
99 public static void removeNaNs(TDoubleArrayList [] arrays) { 80 public static void removeNaNs(TDoubleArrayList [] arrays) {
100 81
101 int dest = 0; 82 int dest = 0;
102 83

http://dive4elements.wald.intevation.org