Mercurial > dive4elements > river
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flood_duration/FloodDurationFacet.java Tue Jul 03 17:00:48 2018 +0200 @@ -0,0 +1,53 @@ +/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde + * Software engineering by + * Björnsen Beratende Ingenieure GmbH + * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ +package org.dive4elements.river.artifacts.sinfo.flood_duration; + +import org.dive4elements.artifactdatabase.state.Facet; +import org.dive4elements.river.artifacts.sinfo.common.SInfoResultFacet; +import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; + +/** + * @author Domenico Nardi Tironi + */ +final class FloodDurationFacet extends SInfoResultFacet { + + private static final long serialVersionUID = 1L; + + protected int waterlevelIndex = -1; // for custom result + + private FloodDurationFacet() { + // required for clone operation deepCopy() + } + + public FloodDurationFacet(final int facetIndex, final int resultIndex, final int waterlevelIndex, final String name, final String description, + final ComputeType type, final String yAxisLabelKey, final String hash, final String stateId) { + super(facetIndex, resultIndex, name, description, yAxisLabelKey, type, stateId, hash); + + this.waterlevelIndex = waterlevelIndex; + } + + public int getWaterlevelIndex() { + return this.waterlevelIndex; + } + + /** Copy deeply. */ + @Override + public Facet deepCopy() { + // FIXME: why not simply use the full constructor instead? + final FloodDurationFacet copy = new FloodDurationFacet(); + // FIXME: why does DataFacet does not override set? Bad access to variables of parent! + copy.set(this); + copy.type = this.type; + copy.hash = this.hash; + copy.stateId = this.stateId; + copy.waterlevelIndex = this.waterlevelIndex; + return copy; + } +} \ No newline at end of file