annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java @ 5863:4897a58c8746

River artifacts: Added new copyright headers.
author Sascha L. Teichmann <teichmann@intevation.de>
date Sun, 28 Apr 2013 14:40:59 +0200
parents 5aa05a7a34b7
children af13ceeba52a
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 *
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
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
4897a58c8746 River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
6 * documentation coming with Dive4Elements River for details.
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
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
14 public class BedHeightSingle
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
15 extends BedHeight
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
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
18 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
19 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
20 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
21
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
22 public BedHeightSingle() {
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
23 super();
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
24 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
25 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
26 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
27 }
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
28
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
29 public BedHeightSingle(String name) {
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
30 super(name);
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
31 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
32 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
33 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
34 }
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
35
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
36 public void add(
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
37 double value,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
38 double station,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
39 double gap,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
40 double width,
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
41 int year
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
42 ) {
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
43 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
44 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
45 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
46 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
47 }
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
48
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
49 public int getYear() {
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
50 return this.year;
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
51 }
3897
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
52
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
53 public double getMorphWidth(int idx) {
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
54 return this.morphWidth.get(idx);
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
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
57 public double getDataGap(int idx) {
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
58 return this.data_gap.get(idx);
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
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
61 public double getMorphWidth(double station) {
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
62 if (this.station.indexOf(station) >= 0) {
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
63 return this.morphWidth.get(this.station.indexOf(station));
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 return Double.NaN;
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
66 }
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
67
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
68 public double getDataGap(double station) {
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
69 if (this.station.indexOf(station) >= 0) {
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
70 return this.getDataGap(this.station.indexOf(station));
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
71 }
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
72 return Double.NaN;
bce2dd4310a6 MINFO: Updated data fields to fit the needs of bedheight difference calculation.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 3886
diff changeset
73 }
4533
0a0ab6909cd8 Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3897
diff changeset
74
0a0ab6909cd8 Add method to get all morph width of a BedHeigthSingle object
Björn Ricks <bjoern.ricks@intevation.de>
parents: 3897
diff changeset
75 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
76 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
77 }
3886
633fbb61a0cc Split bed heights into bed height epochs and single bed heights.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
diff changeset
78 }

http://dive4elements.wald.intevation.org