Mercurial > dive4elements > river
changeset 2385:83abe19d4f40
Added a method Gauge.fetchMasterDischargeTable() to retrieve the discharge table with kind = 0.
flys-backend/trunk@3994 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 09 Feb 2012 11:30:26 +0000 |
parents | 385170ff7b34 |
children | cb7ebcadb214 67f362883fe4 |
files | flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/model/Gauge.java |
diffstat | 2 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-backend/ChangeLog Mon Feb 06 07:36:51 2012 +0000 +++ b/flys-backend/ChangeLog Thu Feb 09 11:30:26 2012 +0000 @@ -1,3 +1,8 @@ +2012-02-09 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/model/Gauge.java: Added a method + getMasterDischargeTable() to retrieve the discharge table with kind 0. + 2012-02-03 Felix Wolfsteller <felix.wolfsteller@intevation.de> * src/main/java/de/intevation/flys/model/River.java
--- a/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Mon Feb 06 07:36:51 2012 +0000 +++ b/flys-backend/src/main/java/de/intevation/flys/model/Gauge.java Thu Feb 09 11:30:26 2012 +0000 @@ -30,6 +30,9 @@ { public static final int DEFAULT_SCALE = 100; + public static final int MASTER_DISCHARGE_TABLE = 0; + + private Integer id; private String name; private River river; @@ -228,5 +231,16 @@ return results.isEmpty() ? null : results.get(0); } + + + public DischargeTable fetchMasterDischargeTable() { + for (DischargeTable dt: dischargeTables) { + if (dt.getKind() == MASTER_DISCHARGE_TABLE) { + return dt; + } + } + + return null; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :