comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/minfo/BedHeightFacet.java @ 4655:cd44d28d0fbc

Move the access to artifact data to the Access object Use BedHeightAccess class to receive the data from the artifact. This abstracts the data access from the actual artifact.
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 11 Dec 2012 09:44:04 +0100
parents 1619f80eb62e
children a3dc382bc1ca
comparison
equal deleted inserted replaced
4654:861c47e0a8a0 4655:cd44d28d0fbc
1 package de.intevation.flys.artifacts.model.minfo; 1 package de.intevation.flys.artifacts.model.minfo;
2 2
3 import de.intevation.artifacts.Artifact; 3 import de.intevation.artifacts.Artifact;
4 import de.intevation.artifacts.CallContext; 4 import de.intevation.artifacts.CallContext;
5 import de.intevation.flys.artifacts.BedHeightsArtifact; 5 import de.intevation.flys.artifacts.FLYSArtifact;
6 import de.intevation.flys.artifacts.access.BedHeightAccess;
6 import de.intevation.flys.artifacts.model.BlackboardDataFacet; 7 import de.intevation.flys.artifacts.model.BlackboardDataFacet;
7 import de.intevation.flys.artifacts.model.FacetTypes; 8 import de.intevation.flys.artifacts.model.FacetTypes;
8 9
9 public class BedHeightFacet 10 public class BedHeightFacet
10 extends BlackboardDataFacet 11 extends BlackboardDataFacet
27 * 28 *
28 * @return the data. 29 * @return the data.
29 */ 30 */
30 @Override 31 @Override
31 public Object getData(Artifact artifact, CallContext context) { 32 public Object getData(Artifact artifact, CallContext context) {
32 BedHeightsArtifact staticData = 33 BedHeightAccess access = new BedHeightAccess((FLYSArtifact)artifact);
33 (BedHeightsArtifact) artifact;
34 if (type.equals("singlevalues")) { 34 if (type.equals("singlevalues")) {
35 return staticData.getSingleValues(); 35 return access.getSingleValues();
36 } 36 }
37 return staticData.getHeight(); 37 return access.getHeight();
38 } 38 }
39 /** 39 /**
40 * Create a deep copy of this Facet. 40 * Create a deep copy of this Facet.
41 * @return a deep copy. 41 * @return a deep copy.
42 */ 42 */

http://dive4elements.wald.intevation.org