Mercurial > dive4elements > river
annotate artifacts/src/main/java/org/dive4elements/river/artifacts/access/IsOfficialAccess.java @ 8755:30b1ddadf275
(issue1801) Unify reference gauge finding code
The basic way as described in the method comment of the
determineRefGauge method is now used in the WINFOArtifact,
MainValuesService and RiverUtils.getGauge method.
RiverUtils.getGauge previously just returned the first
gauge found. While this is now a behavior change I believe
that it is always more correct then the undeterministic
behavior of the previous implmenentation.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 24 Jun 2015 14:07:26 +0200 |
parents | 9098499114e9 |
children | 5e38e2924c07 |
rev | line source |
---|---|
7618
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
3 * |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
7 */ |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
8 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
9 package org.dive4elements.river.artifacts.access; |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
10 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
11 import org.dive4elements.river.artifacts.D4EArtifact; |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
12 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
13 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
14 /** Access data used to mark whether a certain Wst columns is an official line. */ |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
15 public class IsOfficialAccess extends Access |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
16 { |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
17 protected Boolean isOfficial; |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
18 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
19 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
20 public IsOfficialAccess(D4EArtifact givenArtifact) { |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
21 super(givenArtifact); |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
22 } |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
23 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
24 /** Returns whether the artifact marked its wst col as official. */ |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
25 public Boolean isOfficial() { |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
26 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
27 if (isOfficial == null) { |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
28 String value = getString("official"); |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
29 isOfficial = (value != null && value.equals("1")); |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
30 } |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
31 |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
32 return isOfficial; |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
33 } |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
34 } |
9098499114e9
Added new IsOfficalAccess to avoid keeping data too close to StaticWQKmsArtifact.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
diff
changeset
|
35 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : |