Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.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 | 99912f51468d |
children | cd5e0662f75c |
comparison
equal
deleted
inserted
replaced
8558:d0ea092a32f5 | 8559:6d8d7425a6b5 |
---|---|
17 import org.dive4elements.artifacts.CallContext; | 17 import org.dive4elements.artifacts.CallContext; |
18 import org.dive4elements.river.artifacts.D4EArtifact; | 18 import org.dive4elements.river.artifacts.D4EArtifact; |
19 import org.dive4elements.river.artifacts.access.BedHeightAccess; | 19 import org.dive4elements.river.artifacts.access.BedHeightAccess; |
20 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; | 20 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; |
21 import org.dive4elements.river.artifacts.model.FacetTypes; | 21 import org.dive4elements.river.artifacts.model.FacetTypes; |
22 import org.dive4elements.river.model.BedHeightSingle; | 22 import org.dive4elements.river.model.BedHeight; |
23 import org.dive4elements.river.model.BedHeightSingleValue; | 23 import org.dive4elements.river.model.BedHeightValue; |
24 | 24 |
25 public class BedHeightFacet | 25 public class BedHeightFacet |
26 extends BlackboardDataFacet | 26 extends BlackboardDataFacet |
27 implements FacetTypes { | 27 implements FacetTypes { |
28 | 28 |
50 @Override | 50 @Override |
51 public Object getData(Artifact artifact, CallContext context) { | 51 public Object getData(Artifact artifact, CallContext context) { |
52 BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact); | 52 BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact); |
53 if (type.equals("singlevalues")) { | 53 if (type.equals("singlevalues")) { |
54 /* Former doc (from BedHeightAccess): | 54 /* Former doc (from BedHeightAccess): |
55 * Return a {@link List} of {@link BedHeightSingleValue}s | 55 * Return a {@link List} of {@link BedHeightValue}s |
56 * at the range of the artifact | 56 * at the range of the artifact |
57 * @return List of {@link BedHeightSingleValue}s */ | 57 * @return List of {@link BedHeightValue}s */ |
58 BedHeightSingle single = BedHeightSingle.getBedHeightSingleById( | 58 BedHeight single = BedHeight.getBedHeightById( |
59 access.getHeightId()); | 59 access.getHeightId()); |
60 List<BedHeightSingleValue> bedheightValues = | 60 List<BedHeightValue> bedheightValues = |
61 BedHeightSingleValue.getBedHeightSingleValues( | 61 BedHeightValue.getBedHeightValues( |
62 single, | 62 single, |
63 access.getFrom(), | 63 access.getFrom(), |
64 access.getTo()); | 64 access.getTo()); |
65 double[][] values = new double[2][bedheightValues.size()]; | 65 double[][] values = new double[2][bedheightValues.size()]; |
66 int i = 0; | 66 int i = 0; |
67 for (BedHeightSingleValue bedheightValue : bedheightValues) { | 67 for (BedHeightValue bedheightValue : bedheightValues) { |
68 values[0][i] = bedheightValue.getStation(); | 68 values[0][i] = bedheightValue.getStation(); |
69 values[1][i] = bedheightValue.getHeight(); | 69 values[1][i] = bedheightValue.getHeight(); |
70 i++; | 70 i++; |
71 } | 71 } |
72 return values; | 72 return values; |