changeset 7656:ad5238e3e736

Cosmetics of WstWriter. Actually, a decent class now.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 05 Dec 2013 22:04:15 +0100
parents 81ae2a4873f2
children 84573d5935be
files artifacts/src/main/java/org/dive4elements/river/exports/WstWriter.java
diffstat 1 files changed, 17 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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@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;
     }

http://dive4elements.wald.intevation.org