comparison flys-artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.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/minfo/BedHeightFacet.java@a3dc382bc1ca
children
comparison
equal deleted inserted replaced
5830:160f53ee0870 5831:bd047b71ab37
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 :

http://dive4elements.wald.intevation.org