[Dive4elements-commits] [PATCH 3 of 5] Add method to get name pairs of differences

Wald Commits scm-commit at wald.intevation.org
Mon Jun 10 13:06:42 CEST 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1370862288 -7200
# Node ID db97448f21b7742af15f46b9c8cab499fe416136
# Parent  3e59b64a17c8771b4a9655f3be176a88ee26dcb2
Add method to get name pairs of differences

diff -r 3e59b64a17c8 -r db97448f21b7 artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java
--- 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];


More information about the Dive4elements-commits mailing list