Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQMeasurementFacet.java @ 5831:bd047b71ab37
Repaired internal references
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 12:06:39 +0200 |
parents | flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/sq/SQMeasurementFacet.java@1df6984628c3 |
children |
comparison
equal
deleted
inserted
replaced
5830:160f53ee0870 | 5831:bd047b71ab37 |
---|---|
1 package org.dive4elements.river.artifacts.model.sq; | |
2 | |
3 import org.apache.log4j.Logger; | |
4 | |
5 import org.dive4elements.artifacts.Artifact; | |
6 import org.dive4elements.artifacts.CallContext; | |
7 | |
8 import org.dive4elements.river.artifacts.FLYSArtifact; | |
9 import org.dive4elements.river.artifacts.model.CalculationResult; | |
10 import org.dive4elements.river.artifacts.model.DataFacet; | |
11 import org.dive4elements.river.artifacts.model.FacetTypes; | |
12 import org.dive4elements.river.artifacts.states.DefaultState.ComputeType; | |
13 | |
14 | |
15 /** | |
16 * Facet to show the outliers in a sq relation. | |
17 * | |
18 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
19 */ | |
20 public class SQMeasurementFacet extends DataFacet implements FacetTypes { | |
21 | |
22 private static final Logger log = Logger.getLogger(SQMeasurementFacet.class); | |
23 | |
24 | |
25 private int fractionIdx; | |
26 | |
27 | |
28 public SQMeasurementFacet() { | |
29 } | |
30 | |
31 | |
32 public SQMeasurementFacet( | |
33 int idx, | |
34 int fractionIdx, | |
35 String name, | |
36 String description, | |
37 String hash, | |
38 String stateId | |
39 ) { | |
40 super(idx, name, description, ComputeType.ADVANCE, hash, stateId); | |
41 this.fractionIdx = fractionIdx; | |
42 } | |
43 | |
44 | |
45 @Override | |
46 public Object getData(Artifact artifact, CallContext context) { | |
47 log.debug("SQMeasurementFacet.getData"); | |
48 | |
49 if (!(artifact instanceof FLYSArtifact)) { | |
50 return null; | |
51 } | |
52 | |
53 FLYSArtifact flys = (FLYSArtifact) artifact; | |
54 | |
55 CalculationResult res = (CalculationResult) flys.compute( | |
56 context, ComputeType.ADVANCE, false); | |
57 | |
58 SQResult[] result = (SQResult[]) res.getData(); | |
59 SQFractionResult fResult = result[index].getFraction(fractionIdx); | |
60 | |
61 return fResult.getMeasurements(); | |
62 } | |
63 | |
64 | |
65 @Override | |
66 public SQMeasurementFacet deepCopy() { | |
67 SQMeasurementFacet copy = new SQMeasurementFacet(); | |
68 copy.set(this); | |
69 | |
70 return copy; | |
71 } | |
72 } | |
73 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |