Mercurial > dive4elements > river
changeset 7530:b60485a58d73
SedimentLoadAccess: Slightly improved readability.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 07 Nov 2013 09:43:20 +0100 |
parents | d2867dc7963f |
children | 7302d2af815f |
files | artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java |
diffstat | 1 files changed, 27 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java Thu Nov 07 09:42:19 2013 +0100 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java Thu Nov 07 09:43:20 2013 +0100 @@ -60,36 +60,35 @@ } public int[][] getEpochs() { - if (getYearEpoch().equals("epoch") || - getYearEpoch().equals("off_epoch") - ) { - String data = getString("epochs"); - - if (data == null) { - logger.warn("No 'epochs' parameter specified!"); - return null; - } - - String[] parts = data.split(";"); - - int[][] list = new int[parts.length][]; - - for (int i = 0; i < parts.length; i++) { - String[] values = parts[i].split(","); - TIntArrayList ints = new TIntArrayList(); - try { - ints.add(Integer.parseInt(values[0])); - ints.add(Integer.parseInt(values[1])); - list[i] = ints.toNativeArray(); - } - catch (NumberFormatException nfe) { - logger.warn("Cannot parse int from string: '" + values + "'"); - } - } - return list; + if (!getYearEpoch().equals("epoch") && + !getYearEpoch().equals("off_epoch")) { + return null; } - return null; + String data = getString("epochs"); + + if (data == null) { + logger.warn("No 'epochs' parameter specified!"); + return null; + } + + String[] parts = data.split(";"); + + int[][] list = new int[parts.length][]; + + for (int i = 0; i < parts.length; i++) { + String[] values = parts[i].split(","); + TIntArrayList ints = new TIntArrayList(); + try { + ints.add(Integer.parseInt(values[0])); + ints.add(Integer.parseInt(values[1])); + list[i] = ints.toNativeArray(); + } + catch (NumberFormatException nfe) { + logger.warn("Cannot parse int from string: '" + values + "'"); + } + } + return list; } /** Returns the selected unit (t/a or m3/a). */