diff gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java @ 337:a887074460b6

Last Step of the Refactoring Work on the Transition Model. Splitted Businesslogic between States and Transitions. Splitted the ConfigurationElements of State and Transition in several XML-Fragments. gnv-artifacts/trunk@403 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Tue, 08 Dec 2009 13:38:21 +0000
parents e964a3d8f7bc
children 88cd37c3b5e4
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java	Tue Dec 08 11:18:27 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java	Tue Dec 08 13:38:21 2009 +0000
@@ -46,8 +46,6 @@
  */
 public abstract class StateBase implements State {
 
-    
-
     /**
      * The UID of this Class
      */
@@ -77,8 +75,6 @@
 
     protected String queryID = null;
 
-    private Collection<String> reachableStates = null;
-
     protected Collection<String> inputValueNames = null;
 
     private Map<String, InputValue> inputValues = null;
@@ -109,38 +105,7 @@
         return this.description;
     }
 
-    /**
-     * @see de.intevation.gnv.state.State#reachableStates()
-     */
-    public Collection<String> reachableStates() {
-        
-        if (this.couldAlternativeStateUsed()){
-            Iterator<String> it = this.reachableStates.iterator();
-            String transValue = null;
-            while (it.hasNext()){
-                transValue = it.next();
-            }
-            Collection<String> returnValue = new ArrayList<String>(1);
-            returnValue.add(transValue);
-            return returnValue;
-        }else{
-            return this.reachableStates;
-        }
-        
-    }
 
-    /**
-     * @return
-     */
-    private boolean couldAlternativeStateUsed() {
-     // TODO das muss hier noch etwas freier gestaltet werden.
-        String key = this.dataName;
-        boolean returnValue=this.inputData != null &&
-                            this.inputData.containsKey(key) && 
-                            this.inputData.get(key).getValue().
-                                                    equals(NODATASELECTIONKEY);
-        return returnValue;
-    }
 
     /**
      * @see de.intevation.gnv.state.State#getRequiredInputValues()
@@ -158,15 +123,6 @@
         this.description = ((Element)configuration).getAttribute("description");
 
         log.info("State-ID = " + this.id);
-        NodeList nodes = Config.getNodeSetXPath(configuration,
-                "reachablestates/state");
-        this.reachableStates = new ArrayList<String>(nodes.getLength());
-        for (int i = 0; i < nodes.getLength(); i++) {
-            String reachableState = nodes.item(i).getTextContent();
-            log.info("ReachableState ==> " + reachableState);
-            this.reachableStates.add(reachableState);
-
-        }
         
         NodeList inputValuesNodes = Config.getNodeSetXPath(configuration,
                 "inputvalues/inputvalue");
@@ -390,23 +346,6 @@
     }
 
     /**
-     * @see de.intevation.gnv.state.State#isStateReachable(java.lang.String)
-     */
-    public boolean isStateReachable(String stateID) {
-        log.debug("StateBase.isStateReachable");
-        boolean returnValue = false;
-        Iterator<String> states = reachableStates.iterator();
-        while (states.hasNext()) {
-            if (states.next().equals(stateID)) {
-                log.debug("State " + stateID + " wird unterstützt.");
-                returnValue = true;
-                break;
-            }
-        }
-        return returnValue;
-    }
-
-    /**
      * @see de.intevation.gnv.state.State#advance(java.lang.String,
      *      de.intevation.artifacts.CallMeta)
      */

http://dive4elements.wald.intevation.org