Mercurial > dive4elements > river
comparison 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 |
comparison
equal
deleted
inserted
replaced
2700:b3364af53ab3 | 2701:c553d4fa3957 |
---|---|
602 } | 602 } |
603 | 603 |
604 | 604 |
605 /** | 605 /** |
606 * This method returns the value of a StateData object stored in the data | 606 * This method returns the value of a StateData object stored in the data |
607 * pool of this Artifact as Double. | |
608 * | |
609 * @param name The name of the StateData object. | |
610 * | |
611 * @return an Double representing the value of the data object or null if | |
612 * no object was found for <i>name</i>. | |
613 * | |
614 * @throws NumberFormatException if the value of the data object could not | |
615 * be transformed into a Double. | |
616 */ | |
617 public Double getDataAsDouble(String name) | |
618 throws NumberFormatException | |
619 { | |
620 String value = getDataAsString(name); | |
621 | |
622 if (value != null && value.length() > 0) { | |
623 return Double.parseDouble(value); | |
624 } | |
625 | |
626 return null; | |
627 } | |
628 | |
629 | |
630 /** | |
631 * This method returns the value of a StateData object stored in the data | |
607 * pool of this Artifact as Long. | 632 * pool of this Artifact as Long. |
608 * | 633 * |
609 * @param name The name of the StateData object. | 634 * @param name The name of the StateData object. |
610 * | 635 * |
611 * @return a Long representing the value of the data object or null if | 636 * @return a Long representing the value of the data object or null if |
901 * | 926 * |
902 * @return list of outputs | 927 * @return list of outputs |
903 */ | 928 */ |
904 public List<Output> getOutputs(Object context) { | 929 public List<Output> getOutputs(Object context) { |
905 logger.debug("##### Get Outputs for: " + identifier() + " #####"); | 930 logger.debug("##### Get Outputs for: " + identifier() + " #####"); |
931 | |
932 dumpArtifact(); | |
906 | 933 |
907 List<String> stateIds = getPreviousStateIds(); | 934 List<String> stateIds = getPreviousStateIds(); |
908 List<Output> generated = new ArrayList<Output>(); | 935 List<Output> generated = new ArrayList<Output>(); |
909 | 936 |
910 for (String stateId: stateIds) { | 937 for (String stateId: stateIds) { |