diff flys-backend/src/main/java/de/intevation/flys/model/Gauge.java @ 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 aa777d1aba38
children 8df746f374cc
line wrap: on
line diff
--- 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 :

http://dive4elements.wald.intevation.org