changeset 6599:38ee580a30cb

Add getFirstLastKM utiltity function to WQKms I found this useful.
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 18 Jul 2013 13:13:51 +0200
parents ca56c4e6a755
children df1140486ba4
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java	Thu Jul 18 13:12:39 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java	Thu Jul 18 13:13:51 2013 +0200
@@ -143,5 +143,15 @@
         double to   = getKm(size()-1);
         return from + " - " + to;
     }
+
+    /**
+     * Returns an array of two double values the first and last kilometer.
+     *
+     * @return a double array with the first and last km
+     */
+    public double[] getFirstLastKM() {
+        /* Behold the first km might be larger then the last! */
+        return new double[] {getKm(0), getKm(size()-1)};
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org