annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/collision/CollisionCalcFacet.java @ 9487:504f63512379

Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
author mschaefer
date Tue, 18 Sep 2018 12:21:17 +0200
parents 08f46ccd37ba
children
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;
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9215
diff changeset
14 import org.dive4elements.river.artifacts.common.ResultFacet;
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 */
9347
08f46ccd37ba salix.regional refactoring
gernotbelger
parents: 9215
diff changeset
22 public class CollisionCalcFacet extends ResultFacet {
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;
9487
504f63512379 Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
mschaefer
parents: 9347
diff changeset
25 private String years;
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
9487
504f63512379 Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
mschaefer
parents: 9347
diff changeset
32 public CollisionCalcFacet(final int facetIndex, final int resultIndex, final String years, final String name, final String description,
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
33 final String yAxisLabelKey, final ComputeType type, final String hash, final String stateId) {
9487
504f63512379 Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
mschaefer
parents: 9347
diff changeset
34
9215
0fc9c82e744e work on collison, flood_duration
gernotbelger
parents: 9205
diff changeset
35 super(facetIndex, resultIndex, name, description, yAxisLabelKey, type, stateId, hash);
9487
504f63512379 Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
mschaefer
parents: 9347
diff changeset
36 this.years = years;
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
9487
504f63512379 Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
mschaefer
parents: 9347
diff changeset
39 public String getYears() {
504f63512379 Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
mschaefer
parents: 9347
diff changeset
40 return this.years;
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;
9487
504f63512379 Sinfo collisions: calculation of multiple epochs, avoiding duplicate collision events in the details report
mschaefer
parents: 9347
diff changeset
53 copy.years = this.years;
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