raimund@3887: package de.intevation.flys.artifacts.access; raimund@3887: raimund@3887: import de.intevation.artifacts.CallContext; raimund@3887: import de.intevation.flys.artifacts.FLYSArtifact; raimund@3887: import de.intevation.flys.artifacts.model.minfo.BedHeight; raimund@3887: import de.intevation.flys.utils.FLYSUtils; raimund@3887: import de.intevation.flys.utils.StringUtil; raimund@3887: raimund@3887: raimund@3887: public class BedDifferencesAccess raimund@3887: extends RiverAccess raimund@3887: { raimund@3887: raimund@3887: private String yearEpoch; raimund@3887: private String[] diffs; raimund@3887: raimund@3887: private CallContext context; raimund@3887: raimund@3887: public BedDifferencesAccess(FLYSArtifact artifact, CallContext context) { raimund@3887: super(artifact); raimund@3887: this.context = context; raimund@3887: } raimund@3887: raimund@3887: public String getYearEpoch() { raimund@3887: return yearEpoch; raimund@3887: } raimund@3887: raimund@3887: public FLYSArtifact[][] getDifferenceArtifacts() { raimund@3887: FLYSArtifact[][] artifacts = new FLYSArtifact[diffs.length][2]; raimund@3887: for (int i = 0; i < diffs.length; i++) { raimund@3887: String[] diff = diffs[i].split("#"); raimund@3887: String diff1 = StringUtil.unbracket(diff[0]); raimund@3887: String diff2 = StringUtil.unbracket(diff[1]); raimund@3887: String[] diff1parts = diff1.split(";"); raimund@3887: String[] diff2parts = diff2.split(";"); raimund@3887: artifacts[i][0] = FLYSUtils.getArtifact(diff1parts[0], context); raimund@3887: artifacts[i][1] = FLYSUtils.getArtifact(diff2parts[1], context); raimund@3887: } raimund@3887: return artifacts; raimund@3887: } raimund@3887: raimund@3887: public static int getHeightId(FLYSArtifact artifact) { raimund@3887: Access a = new Access(artifact); raimund@3887: return a.getInteger("height_id"); raimund@3887: } raimund@3887: }