Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 650:6695e03e9b82
Added parser for segments
flys-artifacts/trunk@2043 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Wed, 01 Jun 2011 17:01:44 +0000 |
parents | f0c1250d1e7b |
children | 913b52064449 |
comparison
equal
deleted
inserted
replaced
649:44175d4720f8 | 650:6695e03e9b82 |
---|---|
1 package de.intevation.flys.artifacts; | 1 package de.intevation.flys.artifacts; |
2 | 2 |
3 import java.util.ArrayList; | 3 import java.util.ArrayList; |
4 import java.util.Collection; | 4 import java.util.Collection; |
5 import java.util.Collections; | |
5 import java.util.HashMap; | 6 import java.util.HashMap; |
6 import java.util.List; | 7 import java.util.List; |
7 import java.util.Map; | 8 import java.util.Map; |
8 import java.util.Set; | 9 import java.util.Set; |
9 import java.util.Vector; | 10 import java.util.Vector; |
35 import de.intevation.flys.model.Gauge; | 36 import de.intevation.flys.model.Gauge; |
36 import de.intevation.flys.model.Range; | 37 import de.intevation.flys.model.Range; |
37 import de.intevation.flys.model.River; | 38 import de.intevation.flys.model.River; |
38 | 39 |
39 import de.intevation.flys.artifacts.context.FLYSContext; | 40 import de.intevation.flys.artifacts.context.FLYSContext; |
41 | |
40 import de.intevation.flys.artifacts.model.DischargeTables; | 42 import de.intevation.flys.artifacts.model.DischargeTables; |
41 import de.intevation.flys.artifacts.model.RiverFactory; | 43 import de.intevation.flys.artifacts.model.RiverFactory; |
44 import de.intevation.flys.artifacts.model.Segment; | |
45 | |
42 import de.intevation.flys.artifacts.states.DefaultState; | 46 import de.intevation.flys.artifacts.states.DefaultState; |
43 import de.intevation.flys.artifacts.states.LocationDistanceSelect; | 47 import de.intevation.flys.artifacts.states.LocationDistanceSelect; |
44 | 48 |
45 | 49 |
46 /** | 50 /** |
744 logger.warn("You try to get Qs, but W has been inserted."); | 748 logger.warn("You try to get Qs, but W has been inserted."); |
745 return null; | 749 return null; |
746 } | 750 } |
747 } | 751 } |
748 | 752 |
753 public List<Segment> getSegments() { | |
754 StateData wqValues = getData("wq_values"); | |
755 if (wqValues == null) { | |
756 logger.warn("no wq_values given"); | |
757 return Collections.emptyList(); | |
758 } | |
759 String input = (String)wqValues.getValue(); | |
760 if (input == null || (input = input.trim()).length() == 0) { | |
761 logger.warn("wq_values are empty"); | |
762 return Collections.emptyList(); | |
763 } | |
764 return Segment.parseSegments(input); | |
765 } | |
766 | |
749 | 767 |
750 /** | 768 /** |
751 * Returns the Qs for a number of Ws. This method makes use of | 769 * Returns the Qs for a number of Ws. This method makes use of |
752 * DischargeTables.getQForW(). | 770 * DischargeTables.getQForW(). |
753 * | 771 * |