Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/StaticSQRelation.java @ 6266:c297a61115d0
issue1267: Sort the list of FastCrossSections before binarySearching it.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Tue, 11 Jun 2013 11:59:25 +0200 |
parents | af13ceeba52a |
children |
rev | line source |
---|---|
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5994
af13ceeba52a
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5863
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5863
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
4897a58c8746
River artifacts: Added new copyright headers.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5500
diff
changeset
|
9 package org.dive4elements.river.artifacts.model.sq; |
5500
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 import java.io.Serializable; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 import java.util.Date; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 public class StaticSQRelation implements Serializable{ |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 private Date startTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 private Date stopTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 private String type; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 private Parameter parameter; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 private double a; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 private double b; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 private double qmax; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 public static enum Parameter { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 A, B, C, D, E, F |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 public StaticSQRelation() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 public StaticSQRelation( |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 Date startTime, |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 Date stopTime, |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 String type, |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 Parameter parameter, |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 double a, |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 double b |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 ) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 this.startTime = startTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 this.stopTime = stopTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 this.type = type; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 this.parameter = parameter; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 this.a = a; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 this.b = b; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
49 public Date getStartTime() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 return startTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
51 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 public void setStartTime(Date startTime) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 this.startTime = startTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
57 public Date getStopTime() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
58 return stopTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
59 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
60 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
61 public void setStopTime(Date stopTime) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
62 this.stopTime = stopTime; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
64 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
65 public String getType() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
66 return type; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
67 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
68 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
69 public void setType(String type) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
70 this.type = type; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
71 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
72 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
73 public Parameter getParameter() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
74 return parameter; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
75 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
76 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
77 public void setParameter(Parameter parameter) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
78 this.parameter = parameter; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
79 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
80 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
81 public void setParameter(String parameter) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
82 if (parameter == null) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
83 return; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
84 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
85 this.parameter = Parameter.valueOf(parameter); |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
86 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
87 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
88 public double getA() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
89 return a; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
90 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
91 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
92 public void setA(double a) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
93 this.a = a; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
94 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
95 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
96 public double getB() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
97 return b; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
98 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
99 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
100 public void setB(double b) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
101 this.b = b; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
102 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
103 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
104 public double getQmax() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
105 return qmax; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
106 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
107 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
108 public void setQmax(double qmax) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
109 this.qmax = qmax; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
110 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
111 } |