Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedHeightAccess.java @ 4655:cd44d28d0fbc
Move the access to artifact data to the Access object
Use BedHeightAccess class to receive the data from the artifact. This abstracts
the data access from the actual artifact.
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Tue, 11 Dec 2012 09:44:04 +0100 |
parents | 0f60efc39953 |
children | a3dc382bc1ca |
rev | line source |
---|---|
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
|
1 package de.intevation.flys.artifacts.access; |
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
|
2 |
4655
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
3 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
|
4 |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
5 import de.intevation.flys.artifacts.FLYSArtifact; |
4655
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
6 import de.intevation.flys.artifacts.model.minfo.BedHeight; |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
7 import de.intevation.flys.artifacts.model.minfo.BedHeightFactory; |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
8 import de.intevation.flys.artifacts.states.SoundingsSelect; |
4655
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
9 import de.intevation.flys.model.BedHeightSingle; |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
10 import de.intevation.flys.model.BedHeightSingleValue; |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
11 |
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
|
12 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
|
13 |
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
|
14 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
|
15 |
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
|
16 |
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
|
17 public class BedHeightAccess extends Access { |
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
|
18 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
19 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
|
20 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
21 private int[] singleIDs; |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
22 private int[] epochIDs; |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
23 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
24 private Double lowerKM; |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
25 private Double upperKM; |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
26 |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
27 private String time; |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
28 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
29 public BedHeightAccess(FLYSArtifact artifact) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
30 super(artifact); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
31 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
32 |
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
33 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
34 public Double getLowerKM() { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
35 if (lowerKM == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
36 lowerKM = getDouble("ld_from"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
37 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
38 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
39 return lowerKM; |
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
|
40 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
41 |
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
42 |
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
|
43 public Double getUpperKM() { |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
44 if (upperKM == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
45 upperKM = getDouble("ld_to"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
46 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
47 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
48 return upperKM; |
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
|
49 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
50 |
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
51 |
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
|
52 public int[] getBedHeightSingleIDs() { |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
53 if (singleIDs == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
54 String data = getString("soundings"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
55 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
56 if (data == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
57 logger.warn("No 'soundings' parameter specified!"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
58 return null; |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
59 } |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
60 else { |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
61 logger.debug("getBedHeightSingleIDs(): data=" + data); |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
62 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
63 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
64 String[] parts = data.split(";"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
65 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
66 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
|
67 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
68 for (String part: parts) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
69 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
|
70 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
|
71 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
72 try { |
4150
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
73 int i = Integer.parseInt(tmp); |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
74 if (!ids.contains(i)) { |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
75 ids.add(i); |
0f60efc39953
Workaround for #961
Christian Lins <christian.lins@intevation.de>
parents:
3614
diff
changeset
|
76 } |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
77 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
78 catch (NumberFormatException nfe) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
79 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
|
80 } |
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 singleIDs = ids.toNativeArray(); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
85 } |
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 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
|
88 } |
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 |
3614
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
91 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
|
92 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
|
93 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
|
94 } |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
95 return time; |
68beaa827751
MINFO: Implemented UI and facet/artifact stack for bed height differences.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
3259
diff
changeset
|
96 } |
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 |
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
|
99 public int[] getBedHeightEpochIDs() { |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
100 if (epochIDs == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
101 String data = getString("soundings"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
102 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
103 if (data == null) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
104 logger.warn("No 'soundings' parameter specified!"); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
105 return null; |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
106 } |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
107 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
108 String[] parts = data.split(";"); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
109 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
110 TIntArrayList ids = new TIntArrayList(); |
3232
cdbc457e23e2
Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3230
diff
changeset
|
111 |
3258
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
112 for (String part: parts) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
113 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
|
114 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
|
115 |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
116 try { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
117 ids.add(Integer.parseInt(tmp)); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
118 } |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
119 catch (NumberFormatException nfe) { |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
120 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
|
121 } |
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 epochIDs = ids.toNativeArray(); |
3c006a53e551
Replaced tabs with four spaces each.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3232
diff
changeset
|
126 } |
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 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
|
129 } |
4655
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
130 |
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 * 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
|
133 * @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
|
134 */ |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
135 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
|
136 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
|
137 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
|
138 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
|
139 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
|
140 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
|
141 } |
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 * 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
|
145 * 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
|
146 * @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
|
147 */ |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
148 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
|
149 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
|
150 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
|
151 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
|
152 return BedHeightSingleValue.getBedHeightSingleValues(single, |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
153 artifact.getDataAsDouble("ld_from"), |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
154 artifact.getDataAsDouble("ld_to")); |
cd44d28d0fbc
Move the access to artifact data to the Access object
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4150
diff
changeset
|
155 } |
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
|
156 } |
3259
9422b559b2d5
Added vim lines.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3258
diff
changeset
|
157 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |