Mercurial > dive4elements > river
diff flys-backend/src/main/java/de/intevation/flys/model/Gauge.java @ 4174:eaf83d4ae6b1
Sorted gauges for reference gauge selection in historical discharge calculation based on their name.
Now, Gauge implements the Java Comparable interface and takes its name into account.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 18 Oct 2012 13:12:24 +0200 |
parents | 371e38af6f79 |
children | 0ff0ed6bd340 |
line wrap: on
line diff
--- a/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Thu Oct 18 12:13:48 2012 +0200 +++ b/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Thu Oct 18 13:12:24 2012 +0200 @@ -25,7 +25,7 @@ @Entity @Table(name = "gauges") public class Gauge -implements Serializable +implements Serializable, Comparable<Gauge> { public static final int DEFAULT_SCALE = 100; @@ -325,5 +325,10 @@ return new MinMaxWQ(minw, maxw, minq, maxq); } + + @Override + public int compareTo(Gauge o) { + return getName().compareTo(o.getName()); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :