changeset 661:fdc898a134a7

Use java.util.List instead of java.util.Vector. Removed superfluous imports. flys-artifacts/trunk@2069 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 07 Jun 2011 15:05:12 +0000
parents 627be3ca1ab6
children 60f24fca574a
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java
diffstat 6 files changed, 29 insertions(+), 44 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Tue Jun 07 14:28:44 2011 +0000
+++ b/flys-artifacts/ChangeLog	Tue Jun 07 15:05:12 2011 +0000
@@ -1,18 +1,29 @@
 2011-06-07  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
+	* src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java,
+	  src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java:
+	  Use java.util.List instead of java.util.Vector
+
+	* src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java,
+	  src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java,
+	  src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java,
+	  src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java:
+	  Removed superfluous imports.
+
+2011-06-07  Sascha L. Teichmann <sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/artifacts/states/DefaultState.java:
 	  createItem() is not abstract any longer to avoid code repetitionin sub classes.
 
-	*   src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java,
-	    src/main/java/de/intevation/flys/artifacts/states/LocationDistanceSelect.java,
-	    src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java,
-	    src/main/java/de/intevation/flys/artifacts/states/WQSelect.java,
-	    src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java,
-	    src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java,
-	    src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java,
-	    src/main/java/de/intevation/flys/artifacts/states/CalculationSelect.java:
-		Removed duplicated code, inserted default constructors and Override annotations.
+	* src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java,
+	  src/main/java/de/intevation/flys/artifacts/states/LocationDistanceSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/RiverSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/WQSelect.java,
+	  src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java,
+	  src/main/java/de/intevation/flys/artifacts/states/WQAdapted.java,
+	  src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java,
+	  src/main/java/de/intevation/flys/artifacts/states/CalculationSelect.java:
+	  Removed duplicated code, inserted default constructors and Override annotations.
 
 2011-06-07  Ingo Weinzierl <ingo@intevation.de>
 
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Tue Jun 07 14:28:44 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Tue Jun 07 15:05:12 2011 +0000
@@ -7,7 +7,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Vector;
 
 import javax.xml.xpath.XPathConstants;
 
@@ -86,7 +85,7 @@
     protected String currentStateId;
 
     /** The identifiers of previous states on a stack.*/
-    protected Vector<String> previousStateIds;
+    protected List<String> previousStateIds;
 
     /** The name of the artifact.*/
     protected String name;
@@ -100,7 +99,7 @@
      */
     public FLYSArtifact() {
         data             = new HashMap<String, StateData>();
-        previousStateIds = new Vector<String>();
+        previousStateIds = new ArrayList<String>();
     }
 
 
@@ -224,7 +223,7 @@
         if (isStateReachable(targetState, context)) {
             logger.info("Advance: Step forward");
 
-            Vector<String> prev = getPreviousStateIds();
+            List<String> prev = getPreviousStateIds();
             prev.add(getCurrentStateId());
 
             setCurrentStateId(targetState);
@@ -234,7 +233,7 @@
         else if (isPreviousState(targetState, context)) {
             logger.info("Advance: Step back to");
 
-            Vector<String> prevs = getPreviousStateIds();
+            List<String> prevs = getPreviousStateIds();
             int targetIdx        = prevs.indexOf(targetState);
             int start            = prevs.size() - 1;
 
@@ -310,7 +309,7 @@
      *
      * @return the vector of previous state identifiers.
      */
-    protected Vector<String> getPreviousStateIds() {
+    protected List<String> getPreviousStateIds() {
         return previousStateIds;
     }
 
@@ -422,7 +421,7 @@
     protected boolean isPreviousState(String stateId, Object context) {
         logger.debug("Determine if the state '" + stateId + "' is old.");
 
-        Vector<String> prevs = getPreviousStateIds();
+        List<String> prevs = getPreviousStateIds();
         if (prevs.contains(stateId)) {
             return true;
         }
@@ -1020,7 +1019,7 @@
             }
 
             logger.debug("------ DUMP PREVIOUS STATES ------");
-            Vector<String> stateIds = getPreviousStateIds();
+            List<String> stateIds = getPreviousStateIds();
 
             for (String id: stateIds) {
                 logger.debug("- State: " + id);
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Tue Jun 07 14:28:44 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Tue Jun 07 15:05:12 2011 +0000
@@ -3,7 +3,6 @@
 import java.util.List;
 import java.util.Set;
 import java.util.HashSet;
-import java.util.Vector;
 import java.util.ArrayList;
 
 import org.w3c.dom.Document;
@@ -166,7 +165,7 @@
         CallContext context,
         String      uuid)
     {
-        Vector<String> stateIds = getPreviousStateIds();
+        List<String> stateIds = getPreviousStateIds();
 
         XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
             doc,
@@ -223,7 +222,7 @@
         CallContext context,
         String uuid)
     {
-        Vector<String> stateIds = getPreviousStateIds();
+        List<String> stateIds = getPreviousStateIds();
 
         FLYSContext flysContext = getFlysContext(context);
         StateEngine engine      = (StateEngine) flysContext.get(
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java	Tue Jun 07 14:28:44 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/ComputedDischargeCurveState.java	Tue Jun 07 15:05:12 2011 +0000
@@ -2,14 +2,6 @@
 
 import org.apache.log4j.Logger;
 
-import org.w3c.dom.Element;
-
-import de.intevation.artifacts.Artifact;
-import de.intevation.artifacts.CallContext;
-
-import de.intevation.artifacts.common.utils.XMLUtils;
-
-
 /**
  * The final state that will be reached after the discharge curve calculation
  * mode has been chosen.
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java	Tue Jun 07 14:28:44 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DischargeLongitudinalSection.java	Tue Jun 07 15:05:12 2011 +0000
@@ -2,14 +2,6 @@
 
 import org.apache.log4j.Logger;
 
-import org.w3c.dom.Element;
-
-import de.intevation.artifacts.Artifact;
-import de.intevation.artifacts.CallContext;
-
-import de.intevation.artifacts.common.utils.XMLUtils;
-
-
 public class DischargeLongitudinalSection extends DefaultState {
 
     private static Logger logger =
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java	Tue Jun 07 14:28:44 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DurationCurveState.java	Tue Jun 07 15:05:12 2011 +0000
@@ -2,14 +2,6 @@
 
 import org.apache.log4j.Logger;
 
-import org.w3c.dom.Element;
-
-import de.intevation.artifacts.Artifact;
-import de.intevation.artifacts.CallContext;
-
-import de.intevation.artifacts.common.utils.XMLUtils;
-
-
 /**
  * The final state that will be reached after the duration curve calculation
  * mode has been chosen.

http://dive4elements.wald.intevation.org