Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/sq/SQStaticState.java @ 5506:57f802db5c5a
Removed obsolete imports. Minor code simplifications.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 28 Mar 2013 15:55:34 +0100 |
parents | 9a14eac637ec |
children |
comparison
equal
deleted
inserted
replaced
5505:1b036a409575 | 5506:57f802db5c5a |
---|---|
1 package de.intevation.flys.artifacts.states.sq; | 1 package de.intevation.flys.artifacts.states.sq; |
2 | 2 |
3 import java.text.DateFormat; | 3 import java.text.DateFormat; |
4 import java.text.SimpleDateFormat; | |
5 import java.util.Calendar; | |
6 import java.util.List; | 4 import java.util.List; |
7 | 5 |
8 import javax.swing.text.DateFormatter; | |
9 | 6 |
10 import org.apache.log4j.Logger; | 7 import org.apache.log4j.Logger; |
11 | 8 |
12 import de.intevation.artifactdatabase.state.Facet; | 9 import de.intevation.artifactdatabase.state.Facet; |
13 import de.intevation.flys.artifacts.FLYSArtifact; | 10 import de.intevation.flys.artifacts.FLYSArtifact; |
42 String river = access.getRiver(); | 39 String river = access.getRiver(); |
43 String measurementStation = access.getMeasurementStation(); | 40 String measurementStation = access.getMeasurementStation(); |
44 | 41 |
45 int ms = -1; | 42 int ms = -1; |
46 try { | 43 try { |
47 ms = Integer.valueOf(measurementStation); | 44 ms = Integer.parseInt(measurementStation); |
48 } | 45 } |
49 catch (NumberFormatException nfe) { | 46 catch (NumberFormatException nfe) { |
50 log.error("Unparseable measurement station: " + measurementStation); | 47 log.error("Unparseable measurement station: " + measurementStation); |
51 return null; | 48 return null; |
52 } | 49 } |
53 | 50 |
54 StaticSQContainer sqRelations = | 51 StaticSQContainer sqRelations = |
55 StaticSQFactory.getSQRelations(river, ms); | 52 StaticSQFactory.getSQRelations(river, ms); |
56 | 53 |
57 for (int i = 0; i < StaticSQRelation.Parameter.values().length; i++) { | 54 for (StaticSQRelation.Parameter p: StaticSQRelation.Parameter.values()) { |
58 StaticSQRelation.Parameter p = | |
59 StaticSQRelation.Parameter.values()[i]; | |
60 | 55 |
61 List<StaticSQRelation> relations = | 56 List<StaticSQRelation> relations = |
62 sqRelations.getRelationsByParameter(p); | 57 sqRelations.getRelationsByParameter(p); |
63 if (relations.size() > 0) { | 58 |
59 if (!relations.isEmpty()) { | |
64 int count = 0; | 60 int count = 0; |
65 | 61 |
66 for (StaticSQRelation relation : relations) { | 62 for (StaticSQRelation relation : relations) { |
67 String name = "sq_" + p.toString().toLowerCase() + "_curve"; | 63 String name = "sq_" + p.toString().toLowerCase() + "_curve"; |
68 DateFormat df = | 64 DateFormat df = |