Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedHeightAccess.java @ 3232:cdbc457e23e2
Removed trailing whitespace.
flys-artifacts/trunk@4862 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 03 Jul 2012 12:52:58 +0000 |
parents | b888c5eb65b3 |
children | 3c006a53e551 |
comparison
equal
deleted
inserted
replaced
3231:f6b571220852 | 3232:cdbc457e23e2 |
---|---|
9 | 9 |
10 | 10 |
11 public class BedHeightAccess extends Access { | 11 public class BedHeightAccess extends Access { |
12 | 12 |
13 private static final Logger logger = Logger.getLogger(BedHeightAccess.class); | 13 private static final Logger logger = Logger.getLogger(BedHeightAccess.class); |
14 | 14 |
15 | 15 |
16 private int[] singleIDs; | 16 private int[] singleIDs; |
17 private int[] epochIDs; | 17 private int[] epochIDs; |
18 | 18 |
19 private Double lowerKM; | 19 private Double lowerKM; |
20 private Double upperKM; | 20 private Double upperKM; |
21 | 21 |
22 | 22 |
23 public BedHeightAccess(FLYSArtifact artifact) { | 23 public BedHeightAccess(FLYSArtifact artifact) { |
24 super(artifact); | 24 super(artifact); |
25 } | 25 } |
26 | 26 |
27 | 27 |
28 public Double getLowerKM() { | 28 public Double getLowerKM() { |
29 if (lowerKM == null) { | 29 if (lowerKM == null) { |
30 lowerKM = getDouble("ld_from"); | 30 lowerKM = getDouble("ld_from"); |
31 } | 31 } |
32 | 32 |
33 return lowerKM; | 33 return lowerKM; |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 public Double getUpperKM() { | 37 public Double getUpperKM() { |
38 if (upperKM == null) { | 38 if (upperKM == null) { |
39 upperKM = getDouble("ld_to"); | 39 upperKM = getDouble("ld_to"); |
40 } | 40 } |
41 | 41 |
42 return upperKM; | 42 return upperKM; |
43 } | 43 } |
44 | 44 |
45 | 45 |
46 public int[] getBedHeightSingleIDs() { | 46 public int[] getBedHeightSingleIDs() { |
47 if (singleIDs == null) { | 47 if (singleIDs == null) { |
48 String data = getString("soundings"); | 48 String data = getString("soundings"); |
49 | 49 |
50 if (data == null) { | 50 if (data == null) { |
51 logger.warn("No 'soundings' parameter specified!"); | 51 logger.warn("No 'soundings' parameter specified!"); |
52 return null; | 52 return null; |
53 } | 53 } |
54 | 54 |
55 String[] parts = data.split(";"); | 55 String[] parts = data.split(";"); |
56 | 56 |
57 TIntArrayList ids = new TIntArrayList(); | 57 TIntArrayList ids = new TIntArrayList(); |
58 | 58 |
59 for (String part: parts) { | 59 for (String part: parts) { |
60 if (part.indexOf(SoundingsSelect.PREFIX_SINGLE) >= 0) { | 60 if (part.indexOf(SoundingsSelect.PREFIX_SINGLE) >= 0) { |
61 String tmp = part.replace(SoundingsSelect.PREFIX_SINGLE, ""); | 61 String tmp = part.replace(SoundingsSelect.PREFIX_SINGLE, ""); |
62 | 62 |
63 try { | 63 try { |
64 ids.add(Integer.parseInt(tmp)); | 64 ids.add(Integer.parseInt(tmp)); |
65 } | 65 } |
66 catch (NumberFormatException nfe) { | 66 catch (NumberFormatException nfe) { |
67 logger.warn("Cannot parse int from string: '" + tmp + "'"); | 67 logger.warn("Cannot parse int from string: '" + tmp + "'"); |
68 } | 68 } |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 singleIDs = ids.toNativeArray(); | 72 singleIDs = ids.toNativeArray(); |
73 } | 73 } |
74 | 74 |
75 return singleIDs; | 75 return singleIDs; |
76 } | 76 } |
77 | 77 |
78 | 78 |
79 public int[] getBedHeightEpochIDs() { | 79 public int[] getBedHeightEpochIDs() { |
80 if (epochIDs == null) { | 80 if (epochIDs == null) { |
81 String data = getString("soundings"); | 81 String data = getString("soundings"); |
82 | 82 |
83 if (data == null) { | 83 if (data == null) { |
84 logger.warn("No 'soundings' parameter specified!"); | 84 logger.warn("No 'soundings' parameter specified!"); |
85 return null; | 85 return null; |
86 } | 86 } |
87 | 87 |
88 String[] parts = data.split(";"); | 88 String[] parts = data.split(";"); |
89 | 89 |
90 TIntArrayList ids = new TIntArrayList(); | 90 TIntArrayList ids = new TIntArrayList(); |
91 | 91 |
92 for (String part: parts) { | 92 for (String part: parts) { |
93 if (part.indexOf(SoundingsSelect.PREFIX_EPOCH) >= 0) { | 93 if (part.indexOf(SoundingsSelect.PREFIX_EPOCH) >= 0) { |
94 String tmp = part.replace(SoundingsSelect.PREFIX_EPOCH, ""); | 94 String tmp = part.replace(SoundingsSelect.PREFIX_EPOCH, ""); |
95 | 95 |
96 try { | 96 try { |
97 ids.add(Integer.parseInt(tmp)); | 97 ids.add(Integer.parseInt(tmp)); |
98 } | 98 } |
99 catch (NumberFormatException nfe) { | 99 catch (NumberFormatException nfe) { |
100 logger.warn("Cannot parse int from string: '" + tmp + "'"); | 100 logger.warn("Cannot parse int from string: '" + tmp + "'"); |
101 } | 101 } |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 epochIDs = ids.toNativeArray(); | 105 epochIDs = ids.toNativeArray(); |
106 } | 106 } |
107 | 107 |
108 return epochIDs; | 108 return epochIDs; |
109 } | 109 } |
110 } | 110 } |