diff gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoProducer.java @ 801:d766fe2d917a

More javadoc. gnv-artifacts/trunk@883 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Tue, 06 Apr 2010 16:53:43 +0000
parents c4156275c1e1
children 4abe172be970
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoProducer.java	Tue Apr 06 13:07:11 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoProducer.java	Tue Apr 06 16:53:43 2010 +0000
@@ -14,24 +14,60 @@
 import java.util.List;
 
 /**
+ * Vectorizer backend to generate iso lines which are able to be visualized
+ * via {@link de.intevation.gnv.jfreechart.PolygonPlot} as line strings
+ * and custom labels on the chart.
+ *
  * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
  */
 public class IsoProducer
 extends      AbstractProducer
 {
+    /**
+     * Iso lines separate two neighbors. This interface decouples
+     * the generation of a suitable label for these to neighbors.
+     */
     public interface AttributeGenerator {
 
+        /**
+         * Generate attribute show as label for two given neighbors.
+         * @param neighbor1 The first neighbor.
+         * @param neighbor2 The second neighbor.
+         * @return The label attribute.
+         */
         Object generateAttribute(int neighbor1, int neighbor2);
 
     } // interface AttributeGenerator
 
+    /**
+     * Internal map of open edge to neighbor attributes.
+     */
     protected HashMap<Edge, Integer>            open;
+    /**
+     * Internal map to associate neighbors with open edges.
+     */
     protected HashMap<IJKey, TIntObjectHashMap> commonOpen;
+    /**
+     * Internal map to associate neighbors with complete rings.
+     */
     protected HashMap<IJKey, ArrayList<Edge>>   complete;
 
+    /**
+     * Width of the index space.
+     */
     protected int    width;
+    /**
+     * Height of the index space.
+     */
     protected int    height;
 
+    /**
+     * Constructor with a given world bounding box.
+     * @param minX Min x coord of the world.
+     * @param minY Min y coord of the world.
+     * @param maxX Max x coord of the world.
+     * @param maxY Max y coord of the world.
+     */
     public IsoProducer(
         double minX, double minY,
         double maxX, double maxY
@@ -112,6 +148,10 @@
 
     } // handleRings
 
+    /**
+     * Join the pairs of neighbors i,j to have a distinct set.
+     * @return The distinct pairs of neighbors.
+     */
     protected HashSet<IJKey> joinPairs() {
         HashSet<IJKey> pairs = new HashSet<IJKey>();
         pairs.addAll(complete  .keySet());
@@ -119,6 +159,11 @@
         return pairs;
     }
 
+    /**
+     * Filter out the head list from the open edge lists.
+     * @param map Map of end and head lists.
+     * @return list of only head lists.
+     */
     protected static ArrayList<Edge> headList(TIntObjectHashMap map) {
         final ArrayList<Edge> headList = new ArrayList<Edge>();
         map.forEachValue(new TObjectProcedure() {
@@ -134,6 +179,9 @@
         return headList;
     }
 
+    /**
+     * Reset internal data structures to save some memory.
+     */
     public void clear() {
         open.clear();
         complete.clear();

http://dive4elements.wald.intevation.org