Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java @ 5867:59ff03ff48f1
River artifacts: Renamed FLYSArtifact(Collection) to D4EArtifact(Collection).
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Sun, 28 Apr 2013 15:23:01 +0200 |
parents | 73da40528cf2 |
children | af13ceeba52a |
comparison
equal
deleted
inserted
replaced
5866:9a6741ccf6d4 | 5867:59ff03ff48f1 |
---|---|
11 import java.util.Arrays; | 11 import java.util.Arrays; |
12 | 12 |
13 import org.apache.log4j.Logger; | 13 import org.apache.log4j.Logger; |
14 | 14 |
15 import org.dive4elements.artifacts.CallContext; | 15 import org.dive4elements.artifacts.CallContext; |
16 import org.dive4elements.river.artifacts.FLYSArtifact; | 16 import org.dive4elements.river.artifacts.D4EArtifact; |
17 import org.dive4elements.river.utils.RiverUtils; | 17 import org.dive4elements.river.utils.RiverUtils; |
18 import org.dive4elements.river.utils.StringUtil; | 18 import org.dive4elements.river.utils.StringUtil; |
19 | 19 |
20 | 20 |
21 public class BedDifferencesAccess | 21 public class BedDifferencesAccess |
25 private String yearEpoch; | 25 private String yearEpoch; |
26 private String[] diffs; | 26 private String[] diffs; |
27 | 27 |
28 private CallContext context; | 28 private CallContext context; |
29 | 29 |
30 public BedDifferencesAccess(FLYSArtifact artifact, CallContext context) { | 30 public BedDifferencesAccess(D4EArtifact artifact, CallContext context) { |
31 super(artifact); | 31 super(artifact); |
32 this.context = context; | 32 this.context = context; |
33 } | 33 } |
34 | 34 |
35 public String getYearEpoch() { | 35 public String getYearEpoch() { |
36 yearEpoch = getString("ye_select"); | 36 yearEpoch = getString("ye_select"); |
37 return yearEpoch; | 37 return yearEpoch; |
38 } | 38 } |
39 | 39 |
40 public FLYSArtifact[][] getDifferenceArtifacts() { | 40 public D4EArtifact[][] getDifferenceArtifacts() { |
41 diffs = getString("diffids").split("#"); | 41 diffs = getString("diffids").split("#"); |
42 logger.debug("diffs: " + Arrays.toString(diffs)); | 42 logger.debug("diffs: " + Arrays.toString(diffs)); |
43 FLYSArtifact[][] artifacts = new FLYSArtifact[diffs.length/2][2]; | 43 D4EArtifact[][] artifacts = new D4EArtifact[diffs.length/2][2]; |
44 for (int i = 0; i < diffs.length; i += 2) { | 44 for (int i = 0; i < diffs.length; i += 2) { |
45 String diff1 = StringUtil.unbracket(diffs[0 + 2*i]); | 45 String diff1 = StringUtil.unbracket(diffs[0 + 2*i]); |
46 String diff2 = StringUtil.unbracket(diffs[1 + 2*i]); | 46 String diff2 = StringUtil.unbracket(diffs[1 + 2*i]); |
47 String[] diff1parts = diff1.split(";"); | 47 String[] diff1parts = diff1.split(";"); |
48 String[] diff2parts = diff2.split(";"); | 48 String[] diff2parts = diff2.split(";"); |
51 artifacts[i][1] = RiverUtils.getArtifact(diff2parts[0], context); | 51 artifacts[i][1] = RiverUtils.getArtifact(diff2parts[0], context); |
52 } | 52 } |
53 return artifacts; | 53 return artifacts; |
54 } | 54 } |
55 | 55 |
56 public static int getHeightId(FLYSArtifact artifact) { | 56 public static int getHeightId(D4EArtifact artifact) { |
57 Access a = new Access(artifact); | 57 Access a = new Access(artifact); |
58 return a.getInteger("height_id"); | 58 return a.getInteger("height_id"); |
59 } | 59 } |
60 } | 60 } |
61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 61 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |