Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/BedDifferencesAccess.java @ 3887:a1c79d84e3cd
New calcultion in MINFO: Bed height difference calculation.
flys-artifacts/trunk@5538 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 20 Sep 2012 09:34:48 +0000 |
parents | |
children | 95d699c769fb |
comparison
equal
deleted
inserted
replaced
3886:633fbb61a0cc | 3887:a1c79d84e3cd |
---|---|
1 package de.intevation.flys.artifacts.access; | |
2 | |
3 import de.intevation.artifacts.CallContext; | |
4 import de.intevation.flys.artifacts.FLYSArtifact; | |
5 import de.intevation.flys.artifacts.model.minfo.BedHeight; | |
6 import de.intevation.flys.utils.FLYSUtils; | |
7 import de.intevation.flys.utils.StringUtil; | |
8 | |
9 | |
10 public class BedDifferencesAccess | |
11 extends RiverAccess | |
12 { | |
13 | |
14 private String yearEpoch; | |
15 private String[] diffs; | |
16 | |
17 private CallContext context; | |
18 | |
19 public BedDifferencesAccess(FLYSArtifact artifact, CallContext context) { | |
20 super(artifact); | |
21 this.context = context; | |
22 } | |
23 | |
24 public String getYearEpoch() { | |
25 return yearEpoch; | |
26 } | |
27 | |
28 public FLYSArtifact[][] getDifferenceArtifacts() { | |
29 FLYSArtifact[][] artifacts = new FLYSArtifact[diffs.length][2]; | |
30 for (int i = 0; i < diffs.length; i++) { | |
31 String[] diff = diffs[i].split("#"); | |
32 String diff1 = StringUtil.unbracket(diff[0]); | |
33 String diff2 = StringUtil.unbracket(diff[1]); | |
34 String[] diff1parts = diff1.split(";"); | |
35 String[] diff2parts = diff2.split(";"); | |
36 artifacts[i][0] = FLYSUtils.getArtifact(diff1parts[0], context); | |
37 artifacts[i][1] = FLYSUtils.getArtifact(diff2parts[1], context); | |
38 } | |
39 return artifacts; | |
40 } | |
41 | |
42 public static int getHeightId(FLYSArtifact artifact) { | |
43 Access a = new Access(artifact); | |
44 return a.getInteger("height_id"); | |
45 } | |
46 } |