Mercurial > dive4elements > river
diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java @ 2701:c553d4fa3957
Moved the implementation of getDataAsDouble() from concrete Artifacts into FLYSArtifact.
flys-artifacts/trunk@4417 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Wed, 16 May 2012 08:21:02 +0000 |
parents | 619f6dfec901 |
children | 7dc4681a2bed |
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Tue May 15 15:31:39 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Wed May 16 08:21:02 2012 +0000 @@ -604,6 +604,31 @@ /** * This method returns the value of a StateData object stored in the data + * pool of this Artifact as Double. + * + * @param name The name of the StateData object. + * + * @return an Double representing the value of the data object or null if + * no object was found for <i>name</i>. + * + * @throws NumberFormatException if the value of the data object could not + * be transformed into a Double. + */ + public Double getDataAsDouble(String name) + throws NumberFormatException + { + String value = getDataAsString(name); + + if (value != null && value.length() > 0) { + return Double.parseDouble(value); + } + + return null; + } + + + /** + * This method returns the value of a StateData object stored in the data * pool of this Artifact as Long. * * @param name The name of the StateData object. @@ -904,6 +929,8 @@ public List<Output> getOutputs(Object context) { logger.debug("##### Get Outputs for: " + identifier() + " #####"); + dumpArtifact(); + List<String> stateIds = getPreviousStateIds(); List<Output> generated = new ArrayList<Output>();