comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/LogSQ.java @ 8539:84929f882fa2

(issue1753) Carry measurement date through SQ values
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 13 Feb 2015 12:34:06 +0100
parents 1c3b2f7dc9a4
children
comparison
equal deleted inserted replaced
8538:c25a8066d99f 8539:84929f882fa2
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the 5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
6 * documentation coming with Dive4Elements River for details. 6 * documentation coming with Dive4Elements River for details.
7 */ 7 */
8 8
9 package org.dive4elements.river.artifacts.model.sq; 9 package org.dive4elements.river.artifacts.model.sq;
10
11 import java.util.Date;
10 12
11 public class LogSQ extends SQ { 13 public class LogSQ extends SQ {
12 14
13 public static final View LOG_SQ_VIEW = new View() { 15 public static final View LOG_SQ_VIEW = new View() {
14 @Override 16 @Override
18 20
19 @Override 21 @Override
20 public double getQ(SQ sq) { 22 public double getQ(SQ sq) {
21 return ((LogSQ)sq).getLogQ(); 23 return ((LogSQ)sq).getLogQ();
22 } 24 }
25
26 @Override
27 public Date getDate(SQ sq) {
28 return sq.getDate();
29 }
23 }; 30 };
24 31
25 public static final Factory LOG_SQ_FACTORY = new Factory() { 32 public static final Factory LOG_SQ_FACTORY = new Factory() {
26 @Override 33 @Override
27 public SQ createSQ(double s, double q) { 34 public SQ createSQ(double s, double q, Date d) {
28 return new LogSQ(s, q); 35 return new LogSQ(s, q, d);
29 } 36 }
30 }; 37 };
31 38
32 protected double logS; 39 protected double logS;
33 protected double logQ; 40 protected double logQ;
35 protected boolean logTrans; 42 protected boolean logTrans;
36 43
37 public LogSQ() { 44 public LogSQ() {
38 } 45 }
39 46
40 public LogSQ(double s, double q) { 47 public LogSQ(double s, double q, Date d) {
41 super(s, q); 48 super(s, q, d);
42 } 49 }
43 50
44 /** important: We cannot process negative s/q. */ 51 /** important: We cannot process negative s/q. */
45 @Override 52 @Override
46 public boolean isValid() { 53 public boolean isValid() {

http://dive4elements.wald.intevation.org