Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java @ 6800:1976350aa8dc double-precision
Importer Doc: reformat tables in parser descriptions of geo-importer.
author | Tom Gottfried <tom.gottfried@intevation.de> |
---|---|
date | Fri, 09 Aug 2013 15:42:36 +0200 |
parents | 29dc6b6e7199 |
children | 534850c9fabc |
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:
5867
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:
5867
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:
4828
diff
changeset
|
9 package org.dive4elements.river.artifacts.access; |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
4655
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
11 import java.util.List; |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
12 |
5867
59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
13 import org.dive4elements.river.artifacts.D4EArtifact; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4828
diff
changeset
|
14 import org.dive4elements.river.artifacts.model.minfo.BedHeight; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4828
diff
changeset
|
15 import org.dive4elements.river.artifacts.model.minfo.BedHeightFactory; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4828
diff
changeset
|
16 import org.dive4elements.river.artifacts.states.SoundingsSelect; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4828
diff
changeset
|
17 import org.dive4elements.river.model.BedHeightSingle; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
4828
diff
changeset
|
18 import org.dive4elements.river.model.BedHeightSingleValue; |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
19 |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 import gnu.trove.TIntArrayList; |
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 |
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 import org.apache.log4j.Logger; |
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 |
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
4826
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4655
diff
changeset
|
25 public class BedHeightAccess |
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4655
diff
changeset
|
26 extends RangeAccess |
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4655
diff
changeset
|
27 { |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
29 private static final Logger logger = Logger.getLogger(BedHeightAccess.class); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
30 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
31 private int[] singleIDs; |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
32 private int[] epochIDs; |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
33 |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
34 private String time; |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
35 |
6101
a0078e5e3b39
Removed unused context from RangeAccess and subclasses leading to some dead code removal.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
36 public BedHeightAccess(D4EArtifact artifact) { |
a0078e5e3b39
Removed unused context from RangeAccess and subclasses leading to some dead code removal.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5994
diff
changeset
|
37 super(artifact); |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
38 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
39 |
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
40 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
41 public Double getLowerKM() { |
4826
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4655
diff
changeset
|
42 // TODO update callers |
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4655
diff
changeset
|
43 return getFrom(); |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
45 |
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
46 |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 public Double getUpperKM() { |
4826
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4655
diff
changeset
|
48 // TODO update callers |
a3dc382bc1ca
BedHeightAccess, FlowVelocityAccess, SedimentLoadAccess: Inherit from RangeAccess.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4655
diff
changeset
|
49 return getTo(); |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
51 |
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
52 |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 public int[] getBedHeightSingleIDs() { |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
54 if (singleIDs == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
55 String data = getString("soundings"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
56 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
57 if (data == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
58 logger.warn("No 'soundings' parameter specified!"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
59 return null; |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
60 } |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
61 else { |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
62 logger.debug("getBedHeightSingleIDs(): data=" + data); |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
63 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
64 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
65 String[] parts = data.split(";"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
66 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
67 TIntArrayList ids = new TIntArrayList(); |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
69 for (String part: parts) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
70 if (part.indexOf(SoundingsSelect.PREFIX_SINGLE) >= 0) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
71 String tmp = part.replace(SoundingsSelect.PREFIX_SINGLE, ""); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
72 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
73 try { |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
74 int i = Integer.parseInt(tmp); |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
75 if (!ids.contains(i)) { |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
76 ids.add(i); |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
77 } |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
78 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
79 catch (NumberFormatException nfe) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
80 logger.warn("Cannot parse int from string: '" + tmp + "'"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
81 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
82 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
83 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
84 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
85 singleIDs = ids.toNativeArray(); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
86 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
87 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
88 return singleIDs; |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 } |
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 |
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
92 public String getYearEpoch() { |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
93 if (time == null) { |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
94 time = getString("ye_select"); |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
95 } |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
96 return time; |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
97 } |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
98 |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
99 |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 public int[] getBedHeightEpochIDs() { |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
101 if (epochIDs == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
102 String data = getString("soundings"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
103 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
104 if (data == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
105 logger.warn("No 'soundings' parameter specified!"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
106 return null; |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
107 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
108 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
109 String[] parts = data.split(";"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
110 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
111 TIntArrayList ids = new TIntArrayList(); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
112 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
113 for (String part: parts) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
114 if (part.indexOf(SoundingsSelect.PREFIX_EPOCH) >= 0) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
115 String tmp = part.replace(SoundingsSelect.PREFIX_EPOCH, ""); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
116 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
117 try { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
118 ids.add(Integer.parseInt(tmp)); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
119 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
120 catch (NumberFormatException nfe) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
121 logger.warn("Cannot parse int from string: '" + tmp + "'"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
122 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
123 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
124 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
125 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
126 epochIDs = ids.toNativeArray(); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
127 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
128 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
129 return epochIDs; |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
130 } |
4655
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
131 |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
132 /** |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
133 * Return the {@link BedHeight} at the height_id and time of the artifact |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
134 * @return {@link BedHeight} |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
135 */ |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
136 public BedHeight getHeight() { |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
137 logger.debug("getHeight"); |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
138 return BedHeightFactory.getHeight( |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
139 artifact.getDataAsString("type"), |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
140 Integer.parseInt(artifact.getDataAsString("height_id")), |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
141 Integer.parseInt(artifact.getDataAsString("time"))); |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
142 } |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
143 |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
144 /** |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
145 * Return a {@link List} of {@link BedHeightSingleValue}s |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
146 * at the range of the artifact |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
147 * @return List of {@link BedHeightSingleValue}s |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
148 */ |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
149 public List<BedHeightSingleValue> getSingleValues() { |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
150 logger.debug("getSingleValues"); |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
151 BedHeightSingle single = BedHeightSingle.getBedHeightSingleById( |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
152 artifact.getDataAsInteger("height_id")); |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
153 return BedHeightSingleValue.getBedHeightSingleValues(single, |
4828
cb4cc6414447
BedHeightAccess: Use getFrom/getTo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4826
diff
changeset
|
154 getFrom(), |
cb4cc6414447
BedHeightAccess: Use getFrom/getTo.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4826
diff
changeset
|
155 getTo()); |
4655
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
156 } |
3230
b888c5eb65b3
Added new *Access objects for bed height calculation and flow velocity calculation; removed methods for specific data access from MINFOArtifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
157 } |
3259
9422b559b2d5
Added vim lines.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3258
diff
changeset
|
158 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |