Mercurial > dive4elements > river
view flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedDifferencesAccess.java @ 3890:2ca035dbc838
Partial issue880 (dc).
flys-artifacts/trunk@5543 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 21 Sep 2012 07:26:47 +0000 (2012-09-21) |
parents | a1c79d84e3cd |
children | 95d699c769fb |
line wrap: on
line source
package de.intevation.flys.artifacts.access; import de.intevation.artifacts.CallContext; import de.intevation.flys.artifacts.FLYSArtifact; import de.intevation.flys.artifacts.model.minfo.BedHeight; import de.intevation.flys.utils.FLYSUtils; import de.intevation.flys.utils.StringUtil; public class BedDifferencesAccess extends RiverAccess { private String yearEpoch; private String[] diffs; private CallContext context; public BedDifferencesAccess(FLYSArtifact artifact, CallContext context) { super(artifact); this.context = context; } public String getYearEpoch() { return yearEpoch; } public FLYSArtifact[][] getDifferenceArtifacts() { FLYSArtifact[][] artifacts = new FLYSArtifact[diffs.length][2]; for (int i = 0; i < diffs.length; i++) { String[] diff = diffs[i].split("#"); String diff1 = StringUtil.unbracket(diff[0]); String diff2 = StringUtil.unbracket(diff[1]); String[] diff1parts = diff1.split(";"); String[] diff2parts = diff2.split(";"); artifacts[i][0] = FLYSUtils.getArtifact(diff1parts[0], context); artifacts[i][1] = FLYSUtils.getArtifact(diff2parts[1], context); } return artifacts; } public static int getHeightId(FLYSArtifact artifact) { Access a = new Access(artifact); return a.getInteger("height_id"); } }