annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionCalcFacet.java @ 9215:0fc9c82e744e

work on collison, flood_duration
author gernotbelger
date Tue, 03 Jul 2018 17:00:48 +0200
parents 3dae6b78e1da
children 08f46ccd37ba
rev   line source
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
2 * Software engineering by
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
3 * Björnsen Beratende Ingenieure GmbH
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
5 *
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
6 * This file is Free Software under the GNU AGPL (>=v3)
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
8 * documentation coming with Dive4Elements River for details.
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
9 */
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
10
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
11 package org.dive4elements.river.artifacts.sinfo.collision;
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
12
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
13 import org.dive4elements.artifactdatabase.state.Facet;
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
14 import org.dive4elements.river.artifacts.sinfo.common.SInfoResultFacet;
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
15 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
16
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
17 /**
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
18 * Facet for calculated river bed collision counts
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
19 *
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
20 * @author Matthias Schäfer
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
21 */
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
22 public class CollisionCalcFacet extends SInfoResultFacet {
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
23
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
24 private static final long serialVersionUID = 1;
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
25 private int year;
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
26
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
27 private CollisionCalcFacet() {
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
28 super();
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
29 // required for clone operation deepCopy()
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
30 }
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
31
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
32 public CollisionCalcFacet(final int facetIndex, final int resultIndex, final int year, final String name, final String description,
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
33 final String yAxisLabelKey, final ComputeType type, final String hash, final String stateId) {
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
34 super(facetIndex, resultIndex, name, description, yAxisLabelKey, type, stateId, hash);
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
35
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
36 this.year = year;
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
37 }
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
38
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
39 public int getYear() {
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
40 return this.year;
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
41 }
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
42
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
43 /** Copy deeply. */
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
44 @Override
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
45 public Facet deepCopy() {
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
46 // FIXME: why not simply use the full constructor instead?
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
47 final CollisionCalcFacet copy = new CollisionCalcFacet();
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
48 // FIXME: why does DataFacet does not override set? Bad access to variables of parent!
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
49 copy.set(this);
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
50 copy.type = this.type;
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
51 copy.hash = this.hash;
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
52 copy.stateId = this.stateId;
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
53 copy.year = this.year;
9157
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
54 return copy;
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
55 }
f9bb5d0a6ff3 Added the S-Info collision calculation and chart output
mschaefer
parents:
diff changeset
56 }

http://dive4elements.wald.intevation.org