Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
4173:7d4480c0e68e | 4174:eaf83d4ae6b1 |
---|---|
23 import de.intevation.flys.backend.SessionHolder; | 23 import de.intevation.flys.backend.SessionHolder; |
24 | 24 |
25 @Entity | 25 @Entity |
26 @Table(name = "gauges") | 26 @Table(name = "gauges") |
27 public class Gauge | 27 public class Gauge |
28 implements Serializable | 28 implements Serializable, Comparable<Gauge> |
29 { | 29 { |
30 public static final int DEFAULT_SCALE = 100; | 30 public static final int DEFAULT_SCALE = 100; |
31 | 31 |
32 public static final int MASTER_DISCHARGE_TABLE = 0; | 32 public static final int MASTER_DISCHARGE_TABLE = 0; |
33 | 33 |
323 minq = (BigDecimal)arr[1]; | 323 minq = (BigDecimal)arr[1]; |
324 } | 324 } |
325 | 325 |
326 return new MinMaxWQ(minw, maxw, minq, maxq); | 326 return new MinMaxWQ(minw, maxw, minq, maxq); |
327 } | 327 } |
328 | |
329 @Override | |
330 public int compareTo(Gauge o) { | |
331 return getName().compareTo(o.getName()); | |
332 } | |
328 } | 333 } |
329 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 334 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |