Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java @ 610:6484464d2059
Changed the mechanism for searching for specific parameter collections.
gnv-artifacts/trunk@676 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 11 Feb 2010 11:58:39 +0000 |
parents | f1dc3c2f9be7 |
children | 4b818f13e20a |
comparison
equal
deleted
inserted
replaced
609:22e65fb4c64a | 610:6484464d2059 |
---|---|
36 import de.intevation.gnv.geobackend.base.Result; | 36 import de.intevation.gnv.geobackend.base.Result; |
37 | 37 |
38 import de.intevation.gnv.state.InputData; | 38 import de.intevation.gnv.state.InputData; |
39 import de.intevation.gnv.state.OutputStateBase; | 39 import de.intevation.gnv.state.OutputStateBase; |
40 | 40 |
41 import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData; | |
41 import de.intevation.gnv.state.describedata.KeyValueDescibeData; | 42 import de.intevation.gnv.state.describedata.KeyValueDescibeData; |
43 import de.intevation.gnv.state.describedata.NamedArrayList; | |
42 import de.intevation.gnv.state.describedata.NamedCollection; | 44 import de.intevation.gnv.state.describedata.NamedCollection; |
43 | 45 |
44 import de.intevation.gnv.state.exception.StateException; | 46 import de.intevation.gnv.state.exception.StateException; |
45 | 47 |
46 import de.intevation.gnv.statistics.Statistic; | 48 import de.intevation.gnv.statistics.Statistic; |
528 if (values != null) { | 530 if (values != null) { |
529 Iterator it = values.iterator(); | 531 Iterator it = values.iterator(); |
530 | 532 |
531 while (it.hasNext()) { | 533 while (it.hasNext()) { |
532 KeyValueDescibeData data = (KeyValueDescibeData) it.next(); | 534 KeyValueDescibeData data = (KeyValueDescibeData) it.next(); |
533 | 535 return data.getValue(); |
534 if (data.isSelected()) { | |
535 return data.getValue(); | |
536 } | |
537 } | 536 } |
538 } | 537 |
539 return null; | 538 return ""; |
539 } | |
540 return ""; | |
540 } | 541 } |
541 | 542 |
542 | 543 |
543 /** | 544 /** |
544 * @param outputStream | 545 * @param outputStream |
868 timeGapDefinitions.add(new DefaultTimeGap(unit, | 869 timeGapDefinitions.add(new DefaultTimeGap(unit, |
869 key, | 870 key, |
870 value)); | 871 value)); |
871 } | 872 } |
872 } | 873 } |
873 | |
874 } | 874 } |
875 } | 875 } |
876 } | 876 } |
877 } | 877 } |
878 | 878 |
879 /** | 879 /** |
880 * @param collectionName | 880 * @param collectionName |
881 * @return | 881 * @return |
882 */ | 882 */ |
883 protected Collection<KeyValueDescibeData> getCollection( | 883 protected Collection<KeyValueDescibeData> getCollection( |
884 String collectionName, | 884 String collectionName, |
885 String uuid) { | 885 String uuid) |
886 Iterator<Object> it = this.getDescibeData(uuid).iterator(); | 886 { |
887 while (it.hasNext()) { | 887 NamedCollection<KeyValueDescibeData> c = new NamedArrayList<KeyValueDescibeData>(collectionName); |
888 | 888 |
889 Object o = it.next(); | 889 InputData data = inputData.get(collectionName); |
890 | 890 if (data == null) { |
891 if (o instanceof NamedCollection<?>) { | 891 log.warn("No collection found with name: " + collectionName); |
892 NamedCollection<KeyValueDescibeData> nc = (NamedCollection<KeyValueDescibeData>) o; | 892 return c; |
893 if (nc.getName().equals(collectionName)) { | 893 } |
894 return nc; | 894 |
895 } | 895 c.add(new DefaultKeyValueDescribeData( |
896 } | 896 data.getValue(), data.getDescription(), getID())); |
897 } | 897 |
898 return null; | 898 return c; |
899 } | 899 } |
900 } | 900 } |
901 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : | 901 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |