Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/sinfo/flowdepth/WstSoundingIdPair.java @ 9221:5c34fe17ef15
Exchanged left and right side for waterlevel/sounding selection
author | gernotbelger |
---|---|
date | Wed, 04 Jul 2018 12:00:57 +0200 |
parents | 5d5d482da3e9 |
children |
rev | line source |
---|---|
8946 | 1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde |
2 * Software engineering by | |
3 * Björnsen Beratende Ingenieure GmbH | |
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt | |
5 * | |
6 * This file is Free Software under the GNU AGPL (>=v3) | |
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the | |
8 * documentation coming with Dive4Elements River for details. | |
9 */ | |
10 package org.dive4elements.river.artifacts.sinfo.flowdepth; | |
11 | |
12 import java.util.ArrayList; | |
13 import java.util.Collections; | |
14 import java.util.List; | |
15 | |
16 import org.dive4elements.river.backend.utils.StringUtil; | |
17 | |
18 /** | |
19 * @author Gernot Belger | |
20 */ | |
21 public final class WstSoundingIdPair { | |
22 | |
23 private final String wstId; | |
24 | |
25 private final String soundingId; | |
26 | |
27 public WstSoundingIdPair(final String wstId, final String soundingId) { | |
28 this.wstId = wstId; | |
29 this.soundingId = soundingId; | |
30 } | |
31 | |
32 public String getWstId() { | |
33 return this.wstId; | |
34 } | |
35 | |
36 public String getSoundingId() { | |
37 return this.soundingId; | |
38 } | |
39 | |
40 public static List<WstSoundingIdPair> parsePairs(final String diffids) { | |
41 | |
42 // FIXME: this way of parsing the datacage-ids is repeated all over flys! | |
43 final String datas[] = diffids.split("#"); | |
44 | |
45 final List<WstSoundingIdPair> diffPairs = new ArrayList<>(datas.length); | |
46 | |
47 for (int i = 0; i < datas.length; i += 2) { | |
9221
5c34fe17ef15
Exchanged left and right side for waterlevel/sounding selection
gernotbelger
parents:
8946
diff
changeset
|
48 final String soundingId = StringUtil.unbracket(datas[i]); |
5c34fe17ef15
Exchanged left and right side for waterlevel/sounding selection
gernotbelger
parents:
8946
diff
changeset
|
49 final String wstId = StringUtil.unbracket(datas[i + 1]); |
8946 | 50 |
9221
5c34fe17ef15
Exchanged left and right side for waterlevel/sounding selection
gernotbelger
parents:
8946
diff
changeset
|
51 diffPairs.add(new WstSoundingIdPair(wstId, soundingId)); |
8946 | 52 } |
53 | |
54 return Collections.unmodifiableList(diffPairs); | |
55 } | |
56 } |