changeset 6241:db97448f21b7

Add method to get name pairs of differences
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 10 Jun 2013 13:04:48 +0200
parents 3e59b64a17c8
children 34f393434913
files artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java	Mon Jun 10 13:04:17 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java	Mon Jun 10 13:04:48 2013 +0200
@@ -68,6 +68,21 @@
         return differenceArtifactIds;
     }
 
+    public String[] getDifferenceArtifactNamePairs() {
+
+        String [] diffs = getDiffs();
+        String [] result = new String[diffs.length/2];
+        for (int i = 0; i < diffs.length/2; i++) {
+            String diff1 = StringUtil.unbracket(diffs[0 + 2*i]);
+            String diff2 = StringUtil.unbracket(diffs[1 + 2*i]);
+            String[] diff1parts = diff1.split(";");
+            String[] diff2parts = diff2.split(";");
+            result[i] = diff1parts[3] + " - " + diff2parts[3];
+        }
+
+        return result;
+    }
+
     public int [][] extractHeightIds(CallContext context) {
         String [][] artifactsIds = getDifferenceArtifactIds();
         int [][] ids = new int[artifactsIds.length][2];

http://dive4elements.wald.intevation.org