Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingleData.java @ 7391:9513d1af7d58
Renamed artifacts/**/BedHeight(Single) to BedHeight(Single)Data, to resolve
class name conflict with class in backend.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 17 Oct 2013 15:08:59 +0200 |
parents | artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java@3c8147ba35a6 |
children | 8faa8cfd2385 |
comparison
equal
deleted
inserted
replaced
7390:45e3bb00ce1a | 7391:9513d1af7d58 |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.artifacts.model.minfo; | |
10 | |
11 import gnu.trove.TDoubleArrayList; | |
12 | |
13 | |
14 public class BedHeightSingleData | |
15 extends BedHeightData | |
16 { | |
17 protected int year; | |
18 protected TDoubleArrayList data_gap; | |
19 protected TDoubleArrayList morphWidth; | |
20 | |
21 public BedHeightSingleData() { | |
22 super(); | |
23 this.year = -1; | |
24 data_gap = new TDoubleArrayList(); | |
25 morphWidth = new TDoubleArrayList(); | |
26 } | |
27 | |
28 public BedHeightSingleData(String name) { | |
29 super(name); | |
30 this.year = -1; | |
31 data_gap = new TDoubleArrayList(); | |
32 morphWidth = new TDoubleArrayList(); | |
33 } | |
34 | |
35 public void add( | |
36 double value, | |
37 double station, | |
38 double gap, | |
39 double width, | |
40 int year | |
41 ) { | |
42 super.add(value, station); | |
43 this.year = year; | |
44 this.data_gap.add(gap); | |
45 this.morphWidth.add(width); | |
46 } | |
47 | |
48 public int getYear() { | |
49 return this.year; | |
50 } | |
51 | |
52 public double getMorphWidth(int idx) { | |
53 return this.morphWidth.getQuick(idx); | |
54 } | |
55 | |
56 public double getDataGap(int idx) { | |
57 return this.data_gap.getQuick(idx); | |
58 } | |
59 | |
60 public double getMorphWidth(double station) { | |
61 int index = this.station.indexOf(station); | |
62 return index >= 0 ? morphWidth.getQuick(index): Double.NaN; | |
63 } | |
64 | |
65 public double getDataGap(double station) { | |
66 int index = this.station.indexOf(station); | |
67 return index >= 0 ? data_gap.getQuick(index) : Double.NaN; | |
68 } | |
69 | |
70 public double[] getMorphWidths() { | |
71 return this.morphWidth.toNativeArray(); | |
72 } | |
73 } |