annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingleData.java @ 7395:5126cadaed58

BedHeightProcessor: Set axis label.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 17 Oct 2013 15:36:13 +0200
parents 9513d1af7d58
children 8faa8cfd2385
rev   line source
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5994
af13ceeba52a Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5863
diff changeset
6 * documentation coming with Dive4Elements River for details.
5863
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5831
bd047b71ab37 Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents: 4533
diff changeset
9 package org.dive4elements.river.artifacts.model.minfo;
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
10
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
11 import gnu.trove.TDoubleArrayList;
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
12
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
13
7391
9513d1af7d58 Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6149
diff changeset
14 public class BedHeightSingleData
9513d1af7d58 Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6149
diff changeset
15 extends BedHeightData
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
16 {
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
17 protected int year;
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
18 protected TDoubleArrayList data_gap;
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
19 protected TDoubleArrayList morphWidth;
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
20
7391
9513d1af7d58 Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6149
diff changeset
21 public BedHeightSingleData() {
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 super();
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 this.year = -1;
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
24 data_gap = new TDoubleArrayList();
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
25 morphWidth = new TDoubleArrayList();
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
26 }
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
27
7391
9513d1af7d58 Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 6149
diff changeset
28 public BedHeightSingleData(String name) {
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 super(name);
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 this.year = -1;
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
31 data_gap = new TDoubleArrayList();
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
32 morphWidth = new TDoubleArrayList();
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
33 }
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
34
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35 public void add(
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 double value,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 double station,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 double gap,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 double width,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 int year
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 ) {
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
42 super.add(value, station);
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
43 this.year = year;
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
44 this.data_gap.add(gap);
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
45 this.morphWidth.add(width);
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
46 }
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
47
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48 public int getYear() {
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 return this.year;
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 }
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
51
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
52 public double getMorphWidth(int idx) {
6149
3c8147ba35a6 Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
53 return this.morphWidth.getQuick(idx);
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
54 }
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
55
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
56 public double getDataGap(int idx) {
6149
3c8147ba35a6 Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
57 return this.data_gap.getQuick(idx);
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
58 }
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
59
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
60 public double getMorphWidth(double station) {
6149
3c8147ba35a6 Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
61 int index = this.station.indexOf(station);
3c8147ba35a6 Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
62 return index >= 0 ? morphWidth.getQuick(index): Double.NaN;
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
63 }
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
64
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
65 public double getDataGap(double station) {
6149
3c8147ba35a6 Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
66 int index = this.station.indexOf(station);
3c8147ba35a6 Bed height: Removed braindead index determination code.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5994
diff changeset
67 return index >= 0 ? data_gap.getQuick(index) : Double.NaN;
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
68 }
4533
0a0ab6909cd8 Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3897
diff changeset
69
0a0ab6909cd8 Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3897
diff changeset
70 public double[] getMorphWidths() {
0a0ab6909cd8 Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3897
diff changeset
71 return this.morphWidth.toNativeArray();
0a0ab6909cd8 Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3897
diff changeset
72 }
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
73 }

http://dive4elements.wald.intevation.org