Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java @ 5838:5aa05a7a34b7
Rename modules to more fitting names.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 15:23:37 +0200 |
parents | flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java@bd047b71ab37 |
children | 4897a58c8746 |
comparison
equal
deleted
inserted
replaced
5837:d9901a08d0a6 | 5838:5aa05a7a34b7 |
---|---|
1 package org.dive4elements.river.artifacts.model.minfo; | |
2 | |
3 import org.dive4elements.artifacts.Artifact; | |
4 import org.dive4elements.artifacts.CallContext; | |
5 import org.dive4elements.river.artifacts.FLYSArtifact; | |
6 import org.dive4elements.river.artifacts.access.BedHeightAccess; | |
7 import org.dive4elements.river.artifacts.model.BlackboardDataFacet; | |
8 import org.dive4elements.river.artifacts.model.FacetTypes; | |
9 | |
10 public class BedHeightFacet | |
11 extends BlackboardDataFacet | |
12 implements FacetTypes { | |
13 | |
14 private String type; | |
15 | |
16 public BedHeightFacet(String name, String description, String type) { | |
17 this.name = name; | |
18 this.description = description; | |
19 this.type = type; | |
20 this.index = 0; | |
21 } | |
22 | |
23 /** | |
24 * Returns the data this facet requires. | |
25 * | |
26 * @param artifact the owner artifact. | |
27 * @param context the CallContext (ignored). | |
28 * | |
29 * @return the data. | |
30 */ | |
31 @Override | |
32 public Object getData(Artifact artifact, CallContext context) { | |
33 BedHeightAccess access = new BedHeightAccess((FLYSArtifact)artifact, context); | |
34 if (type.equals("singlevalues")) { | |
35 return access.getSingleValues(); | |
36 } | |
37 return access.getHeight(); | |
38 } | |
39 /** | |
40 * Create a deep copy of this Facet. | |
41 * @return a deep copy. | |
42 */ | |
43 @Override | |
44 public BedHeightFacet deepCopy() { | |
45 BedHeightFacet copy = new BedHeightFacet(name, description, type); | |
46 copy.set(this); | |
47 return copy; | |
48 } | |
49 } | |
50 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |