Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSoundingWidthFacet.java @ 8559:6d8d7425a6b5
Bed heights are just bed heights since a while ('single' is obsolete).
author | "Tom Gottfried <tom@intevation.de>" |
---|---|
date | Mon, 16 Feb 2015 11:08:33 +0100 |
parents | 2f640972ecf6 |
children | cd5e0662f75c |
comparison
equal
deleted
inserted
replaced
8558:d0ea092a32f5 | 8559:6d8d7425a6b5 |
---|---|
6 import org.dive4elements.artifacts.CallContext; | 6 import org.dive4elements.artifacts.CallContext; |
7 import org.dive4elements.river.artifacts.D4EArtifact; | 7 import org.dive4elements.river.artifacts.D4EArtifact; |
8 import org.dive4elements.river.artifacts.access.BedHeightAccess; | 8 import org.dive4elements.river.artifacts.access.BedHeightAccess; |
9 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; | 9 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; |
10 import org.dive4elements.river.artifacts.model.FacetTypes; | 10 import org.dive4elements.river.artifacts.model.FacetTypes; |
11 import org.dive4elements.river.model.BedHeightSingle; | 11 import org.dive4elements.river.model.BedHeight; |
12 import org.dive4elements.river.model.BedHeightSingleValue; | 12 import org.dive4elements.river.model.BedHeightValue; |
13 | 13 |
14 | 14 |
15 public class BedHeightSoundingWidthFacet | 15 public class BedHeightSoundingWidthFacet |
16 extends BlackboardDataFacet | 16 extends BlackboardDataFacet |
17 implements FacetTypes | 17 implements FacetTypes |
34 */ | 34 */ |
35 @Override | 35 @Override |
36 public Object getData(Artifact artifact, CallContext context) { | 36 public Object getData(Artifact artifact, CallContext context) { |
37 BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact); | 37 BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact); |
38 /* Former doc (from BedHeightAccess): | 38 /* Former doc (from BedHeightAccess): |
39 * Return a {@link List} of {@link BedHeightSingleValue}s | 39 * Return a {@link List} of {@link BedHeightValue}s |
40 * at the range of the artifact | 40 * at the range of the artifact |
41 * @return List of {@link BedHeightSingleValue}s */ | 41 * @return List of {@link BedHeightValue}s */ |
42 BedHeightSingle single = BedHeightSingle.getBedHeightSingleById( | 42 BedHeight single = BedHeight.getBedHeightById( |
43 access.getHeightId()); | 43 access.getHeightId()); |
44 List<BedHeightSingleValue> bedheightValues = | 44 List<BedHeightValue> bedheightValues = |
45 BedHeightSingleValue.getBedHeightSingleValues( | 45 BedHeightValue.getBedHeightValues( |
46 single, | 46 single, |
47 access.getFrom(), | 47 access.getFrom(), |
48 access.getTo()); | 48 access.getTo()); |
49 double[][] values = new double[2][bedheightValues.size()]; | 49 double[][] values = new double[2][bedheightValues.size()]; |
50 int i = 0; | 50 int i = 0; |
51 for (BedHeightSingleValue bedheightValue : bedheightValues) { | 51 for (BedHeightValue bedheightValue : bedheightValues) { |
52 values[0][i] = bedheightValue.getStation(); | 52 values[0][i] = bedheightValue.getStation(); |
53 values[1][i] = bedheightValue.getSoundingWidth() != null | 53 values[1][i] = bedheightValue.getSoundingWidth() != null |
54 ? bedheightValue.getSoundingWidth() : Double.NaN; | 54 ? bedheightValue.getSoundingWidth() : Double.NaN; |
55 i++; | 55 i++; |
56 } | 56 } |