Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ReferenceGaugeState.java @ 4174:eaf83d4ae6b1
Sorted gauges for reference gauge selection in historical discharge calculation based on their name.
Now, Gauge implements the Java Comparable interface and takes its name into account.
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 18 Oct 2012 13:12:24 +0200 |
parents | 8e66293c5369 |
children | e8a4d2fd25cc |
comparison
equal
deleted
inserted
replaced
4173:7d4480c0e68e | 4174:eaf83d4ae6b1 |
---|---|
1 package de.intevation.flys.artifacts.states; | 1 package de.intevation.flys.artifacts.states; |
2 | 2 |
3 import java.util.Collections; | |
3 import java.util.List; | 4 import java.util.List; |
4 | 5 |
5 import org.w3c.dom.Element; | 6 import org.w3c.dom.Element; |
6 | 7 |
7 import de.intevation.artifacts.Artifact; | 8 import de.intevation.artifacts.Artifact; |
31 String name, | 32 String name, |
32 CallContext context) | 33 CallContext context) |
33 { | 34 { |
34 River river = FLYSUtils.getRiver((FLYSArtifact) artifact); | 35 River river = FLYSUtils.getRiver((FLYSArtifact) artifact); |
35 List<Gauge> gauges = river.getGauges(); | 36 List<Gauge> gauges = river.getGauges(); |
37 Collections.sort(gauges); | |
36 | 38 |
37 int num = gauges != null ? gauges.size() : 0; | 39 int num = gauges != null ? gauges.size() : 0; |
38 | 40 |
39 Element[] opts = new Element[num]; | 41 Element[] opts = new Element[num]; |
40 | 42 |