Mercurial > dive4elements > river
annotate flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/StaticSQContainer.java @ 5680:8cb8b03a423d
Added facets to bed difference config.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Fri, 12 Apr 2013 14:49:04 +0200 |
parents | 700ac898ab0b |
children |
rev | line source |
---|---|
5500
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.artifacts.model.sq; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 import java.util.ArrayList; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 import java.util.List; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 public class StaticSQContainer |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 private String description; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 private String stationName; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 private double km; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 private List<StaticSQRelation> relations; |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 public StaticSQContainer() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 relations = new ArrayList<StaticSQRelation>(); |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 public StaticSQContainer( |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 String stationName, |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 String description, |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 double km |
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 this.stationName = stationName; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 this.description = description; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 this.km = km; |
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 String getDescription() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 return description; |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 public void setDescription(String description) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 this.description = description; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 public String getStationName() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 return stationName; |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 public void setStationName(String stationName) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 this.stationName = stationName; |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 public double getKm() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 return km; |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 public void setKm(double km) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
51 this.km = km; |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 public List<StaticSQRelation> getSQRelations() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 return relations; |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
58 public void setSQRelations(List<StaticSQRelation> relations) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
59 this.relations = relations; |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
62 public void addSQRelation(StaticSQRelation relation) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
63 this.relations.add(relation); |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
66 public StaticSQRelation getSQRelation(int ndx) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
67 return this.relations.get(ndx); |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
70 public int size() { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
71 return this.relations.size(); |
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 |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
74 public List<StaticSQRelation> getRelationsByParameter( |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
75 StaticSQRelation.Parameter parameter |
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 List<StaticSQRelation> result = new ArrayList<StaticSQRelation>(); |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
78 for (StaticSQRelation relation : relations) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
79 if (relation.getParameter() == parameter) { |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
80 result.add(relation); |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
81 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
82 } |
700ac898ab0b
Added Factory and model for static sq relations.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
83 return result; |
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 } |