Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentDensityFacet.java @ 7199:baf04164fcc6
issue1435: Stubs for SedimentDensityFacet and -Artifact.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 30 Sep 2013 09:38:09 +0200 |
parents | |
children | e798658cc0ed |
comparison
equal
deleted
inserted
replaced
7198:f707ee04ac80 | 7199:baf04164fcc6 |
---|---|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde | |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU AGPL (>=v3) | |
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
6 * documentation coming with Dive4Elements River for details. | |
7 */ | |
8 | |
9 package org.dive4elements.river.artifacts.model.minfo; | |
10 | |
11 import java.util.ArrayList; | |
12 import java.util.Collections; | |
13 import java.util.List; | |
14 import java.util.Map; | |
15 | |
16 import gnu.trove.TDoubleArrayList; | |
17 | |
18 import org.dive4elements.artifactdatabase.state.Facet; | |
19 | |
20 import org.dive4elements.artifacts.Artifact; | |
21 import org.dive4elements.artifacts.CallContext; | |
22 | |
23 import org.dive4elements.river.artifacts.D4EArtifact; | |
24 | |
25 import org.dive4elements.river.artifacts.model.CalculationResult; | |
26 import org.dive4elements.river.artifacts.model.DataFacet; | |
27 import org.dive4elements.river.artifacts.model.FacetTypes; | |
28 | |
29 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; | |
30 | |
31 import org.dive4elements.river.utils.RiverUtils; | |
32 | |
33 import org.apache.log4j.Logger; | |
34 | |
35 | |
36 /** Facet to access sediment density values measured in one year. */ | |
37 public class SedimentDensityFacet | |
38 extends DataFacet | |
39 { | |
40 /** Very own logger. */ | |
41 private static Logger logger = Logger.getLogger(SedimentDensityFacet.class); | |
42 | |
43 /** Used as tolerance value when fetching measurement stations. */ | |
44 private static double EPSILON = 1e-5; | |
45 | |
46 | |
47 public SedimentDensityFacet() { | |
48 } | |
49 | |
50 public SedimentDensityFacet(int idx, String name, String description, | |
51 ComputeType type, String stateId, String hash) { | |
52 super(idx, name, description, type, hash, stateId); | |
53 } | |
54 | |
55 @Override | |
56 public Object getData(Artifact artifact, CallContext context) { | |
57 logger.debug("Get data for sediment density at index: " + index); | |
58 | |
59 D4EArtifact flys = (D4EArtifact) artifact; | |
60 | |
61 CalculationResult res = (CalculationResult) flys.compute(context, hash, | |
62 stateId, type, false); | |
63 | |
64 if (res == null) { | |
65 logger.error("No CalculationResult"); | |
66 } | |
67 | |
68 return null; | |
69 } | |
70 | |
71 | |
72 /** Copy deeply. */ | |
73 @Override | |
74 public Facet deepCopy() { | |
75 SedimentDensityFacet copy = new SedimentDensityFacet(); | |
76 copy.set(this); | |
77 copy.type = type; | |
78 copy.hash = hash; | |
79 copy.stateId = stateId; | |
80 return copy; | |
81 } | |
82 } | |
83 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |