[PATCH 1 of 2] Cosmetics of WstWriter. Actually, a decent class now

Wald Commits scm-commit at wald.intevation.org
Fri Dec 6 07:12:51 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1386277455 -3600
# Node ID ad5238e3e7362c59f12dabaadc34a490856c2d54
# Parent  81ae2a4873f228ea893fc8a42fb782026a0749e9
Cosmetics of WstWriter. Actually, a decent class now.

diff -r 81ae2a4873f2 -r ad5238e3e736 artifacts/src/main/java/org/dive4elements/river/exports/WstWriter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WstWriter.java	Thu Dec 05 19:37:59 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WstWriter.java	Thu Dec 05 22:04:15 2013 +0100
@@ -30,6 +30,17 @@
 /**
  * A writer that creates WSTs.
  *
+ * Wst files follow this basic structure:
+ *
+ * HEADER
+ * Q-LINE
+ * W-LINES
+ * Q-LINE
+ * W-LINES
+ * ...
+ *
+ * where each *LINE consists of X columns that are specified in the header.
+ *
  * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
  */
 public class WstWriter {
@@ -56,13 +67,13 @@
     protected double[] qs;
 
 
-
     /**
      * This constructor creates a new WstWriter with a number of Q columns.
      *
-     * @param cols The number of columns of the resulting WST.
+     * @param columns The number of columns of the resulting WST.
      */
-    public WstWriter(int cols) {
+    public WstWriter(int columns) {
+        this.cols        = columns;
         this.columnNames = new ArrayList<String>(cols);
         this.lines       = new HashMap<Double, WstLine>();
         this.qs          = new double[cols];
@@ -100,7 +111,7 @@
     /**
      * This method is used to add a new line to the WST.
      *
-     * @param wqkms A 3dim double array with [W,Q, KM].
+     * @param wqkms A 3dim double array with [W, Q, KM].
      */
     public void add(double[] wqkms) {
         Double km = wqkms[2];
@@ -259,7 +270,8 @@
 
     /**
      * Get the lines that have alreay been added to this writer
-     * lines are a map with km as the key and a wstline as value */
+     * lines are a map with km as the key and a wstline as value.
+     */
     public Map<Double, WstLine> getLines() {
         return lines;
     }


More information about the Dive4elements-commits mailing list