Mercurial > dive4elements > river
diff artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java @ 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 | 5fda7065b74a |
children | 3c4efd4b2c19 |
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 :