Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWaterlevelFacet.java @ 9495:bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
author | gernotbelger |
---|---|
date | Tue, 25 Sep 2018 16:43:51 +0200 |
parents | b992c7f6b3ad |
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:
5644
diff
changeset
|
9 package org.dive4elements.river.artifacts.model.fixings; |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5644
diff
changeset
|
11 import org.dive4elements.artifactdatabase.state.Facet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5644
diff
changeset
|
12 import org.dive4elements.river.artifacts.model.CalculationResult; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5644
diff
changeset
|
13 import org.dive4elements.river.artifacts.model.WQKms; |
9495
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
14 import org.dive4elements.river.artifacts.model.WQKmsResult; |
5831
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5644
diff
changeset
|
15 import org.dive4elements.river.artifacts.model.WaterlevelFacet; |
bd047b71ab37
Repaired internal references
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5644
diff
changeset
|
16 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 |
5644 | 18 /** Waterlevel from fix realize compute. */ |
9495
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
19 public class FixWaterlevelFacet extends WaterlevelFacet { |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 public FixWaterlevelFacet() { |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
21 } |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
22 |
9495
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
23 public FixWaterlevelFacet(final int index, final String name, final String description) { |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 super(index, name, description, ComputeType.ADVANCE, null, null); |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 } |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
26 |
9495
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
27 public FixWaterlevelFacet(final int index, final String name, final String description, final ComputeType type, final String hash, final String stateID) { |
6488
b992c7f6b3ad
FixWaterlevelFacet: Turn around hash and stateId parameter in constructor, as in DataFacet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
28 // Note that in super, hash and stateID are on switched positions. |
b992c7f6b3ad
FixWaterlevelFacet: Turn around hash and stateId parameter in constructor, as in DataFacet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
29 // on super.super it is this way around again. |
b992c7f6b3ad
FixWaterlevelFacet: Turn around hash and stateId parameter in constructor, as in DataFacet.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5994
diff
changeset
|
30 super(index, name, description, type, stateID, hash); |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 } |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 @Override |
9495
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
34 protected WQKms[] getWQKms(final CalculationResult res) { |
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
35 if (res.getData() instanceof WQKmsResult) { |
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
36 final WQKmsResult fr = (WQKmsResult) res.getData(); |
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
37 return fr != null ? fr.getWQKms() : null; |
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
38 } |
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
39 return null; |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 } |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 /** Copy deeply. */ |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 @Override |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 public Facet deepCopy() { |
9495
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
45 final FixWaterlevelFacet copy = new FixWaterlevelFacet(); |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 copy.set(this); |
9495
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
47 copy.type = this.type; |
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
48 copy.hash = this.hash; |
bb278c927b66
Datenkorb bezugswasserstände längsschnitte + minor fixes
gernotbelger
parents:
6488
diff
changeset
|
49 copy.stateId = this.stateId; |
3461
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 return copy; |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 } |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 } |
1481322efc02
FixA: Removed instanceof hack to fetch the WQKms of the fix realizations.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |