comparison artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationFacet.java @ 9215:0fc9c82e744e

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

http://dive4elements.wald.intevation.org