comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFacet.java @ 4534:1619f80eb62e

Add type member variable to BedHeightFacet The type can either be single, epoch or singlevalues.
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 15 Nov 2012 16:18:02 +0100
parents ebfce31c7eec
children cd44d28d0fbc
comparison
equal deleted inserted replaced
4533:0a0ab6909cd8 4534:1619f80eb62e
8 8
9 public class BedHeightFacet 9 public class BedHeightFacet
10 extends BlackboardDataFacet 10 extends BlackboardDataFacet
11 implements FacetTypes { 11 implements FacetTypes {
12 12
13 public BedHeightFacet(String description) { 13 private String type;
14 this(STATIC_BEDHEIGHT, description);
15 }
16 14
17 public BedHeightFacet(String name, String description) { 15 public BedHeightFacet(String name, String description, String type) {
18 this.name = name; 16 this.name = name;
19 this.description = description; 17 this.description = description;
18 this.type = type;
20 this.index = 0; 19 this.index = 0;
21 } 20 }
22 21
23 /** 22 /**
24 * Returns the data this facet requires. 23 * Returns the data this facet requires.
30 */ 29 */
31 @Override 30 @Override
32 public Object getData(Artifact artifact, CallContext context) { 31 public Object getData(Artifact artifact, CallContext context) {
33 BedHeightsArtifact staticData = 32 BedHeightsArtifact staticData =
34 (BedHeightsArtifact) artifact; 33 (BedHeightsArtifact) artifact;
34 if (type.equals("singlevalues")) {
35 return staticData.getSingleValues();
36 }
35 return staticData.getHeight(); 37 return staticData.getHeight();
36 } 38 }
37 /** 39 /**
38 * Create a deep copy of this Facet. 40 * Create a deep copy of this Facet.
39 * @return a deep copy. 41 * @return a deep copy.
40 */ 42 */
41 @Override 43 @Override
42 public BedHeightFacet deepCopy() { 44 public BedHeightFacet deepCopy() {
43 BedHeightFacet copy = new BedHeightFacet(description); 45 BedHeightFacet copy = new BedHeightFacet(name, description, type);
44 copy.set(this); 46 copy.set(this);
45 return copy; 47 return copy;
46 } 48 }
47 } 49 }
48 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 50 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org