changeset 809:d05b17a4f3d0

Added javadoc in describedata package. gnv-artifacts/trunk@891 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 09 Apr 2010 07:27:38 +0000
parents 2e951160c43d
children 991e13c3d504
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java
diffstat 11 files changed, 207 insertions(+), 73 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Fri Apr 09 07:27:38 2010 +0000
@@ -1,3 +1,17 @@
+2010-04-09  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	* src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java,
+	  src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java,
+	  src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java,
+	  src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java,
+	  src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java,
+	  src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java,
+	  src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java,
+	  src/main/java/de/intevation/gnv/state/describedata/DescribeData.java,
+	  src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java,
+	  src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java:
+	  More Javadoc.
+
 2010-04-08	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/gnv/math/Interpolation3D.java,
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -1,14 +1,13 @@
 package de.intevation.gnv.state.describedata;
 
 /**
+ * This is the default implementation of <code>KeyValueDescibeData</code>. This
+ * class just implements the necessary methods and two constructors.
+ * 
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
- *
  */
 public class DefaultKeyValueDescribeData implements KeyValueDescibeData {
 
-    /**
-     *
-     */
     private static final long serialVersionUID = -924469415242703108L;
 
     private String key;
@@ -19,10 +18,25 @@
 
     private boolean selected = false;
 
+    /**
+     * Creates a new instance of this class with a key-value pair, but no state
+     * and no selection.
+     *
+     * @param key The key.
+     * @param value A value.
+     */
     public DefaultKeyValueDescribeData(String key, String value) {
         this(key, value, null);
     }
 
+    /**
+     * Creates a new instance of this class with a key-value pair and the state
+     * this object belongs to.
+     *
+     * @param key The key.
+     * @param value A value.
+     * @param state A state.
+     */
     public DefaultKeyValueDescribeData(String key, String value, String state) {
         super();
         this.key = key;
@@ -30,37 +44,24 @@
         this.state = state;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#getKey()
-     */
     public String getKey() {
         return this.key;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#getValue()
-     */
     public String getValue() {
         return this.value;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#isSelected()
-     */
     public boolean isSelected() {
         return this.selected;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#setSelected(boolean)
-     */
     public void setSelected(boolean selected) {
         this.selected = selected;
     }
 
-
     public String getState() {
         return this.state;
     }
-
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -2,13 +2,9 @@
 
 /**
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
- *
  */
 public class DefaultMinMaxDescribeData implements MinMaxDescribeData {
 
-    /**
-     *
-     */
     private static final long serialVersionUID = -2917176219029052295L;
 
     private Object minValue = null;
@@ -24,7 +20,12 @@
     private final static String maxName = "maxvalue";
 
     /**
-     * Constructor
+     * The default constructor.
+     *
+     * @param name A general name for this object.
+     * @param minValue The min value.
+     * @param maxValue The max value.
+     * @param state The state.
      */
     public DefaultMinMaxDescribeData(
         String name,
@@ -39,22 +40,18 @@
         this.state    = state;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMaxValue()
-     */
     public Object getMaxValue() {
         return this.maxValue;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMinValue()
-     */
     public Object getMinValue() {
         return this.minValue;
     }
 
     /**
-     * @see java.lang.Object#toString()
+     * Returns the string representation of this object.
+     *
+     * @return this object as string.
      */
     @Override
     public String toString() {
@@ -62,30 +59,18 @@
                + this.maxValue.toString();
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getName()
-     */
     public String getMinName() {
         return minName;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMaxName()
-     */
     public String getMaxName() {
         return maxName;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#setMaxValue(java.lang.Object)
-     */
     public void setMaxValue(Object maxValue) {
         this.maxValue = maxValue;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#setMinValue(java.lang.Object)
-     */
     public void setMinValue(Object minValue) {
         this.minValue = minValue;
     }
@@ -97,5 +82,5 @@
     public String getState() {
         return this.state;
     }
-
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -1,14 +1,13 @@
 package de.intevation.gnv.state.describedata;
 
 /**
+ * This is the default implementation of <code>SingleValueDescribeData</code>.
+ * This object is used to store a single value for a specific name.
+ *
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
- *
  */
 public class DefaultSingleValueDescribeData implements SingleValueDescribeData {
 
-    /**
-     *
-     */
     private static final long serialVersionUID = 3580176842483316917L;
 
     private String name = null;
@@ -17,15 +16,22 @@
 
     private String state = null;
 
+    /**
+     * Constructor to create new objects without a specific state.
+     *
+     * @param name The name of this object.
+     * @param value The value of this object.
+     */
     public DefaultSingleValueDescribeData(String name, String value) {
         this(name, value, null);
     }
 
     /**
-     * Constructor
+     * Constructor to create new objects with a specific state.
      *
-     * @param name
-     * @param value
+     * @param name The name of this object.
+     * @param value The value of this object.
+     * @param state The state this object belongs to.
      */
     public DefaultSingleValueDescribeData(
         String name,
@@ -38,16 +44,10 @@
         this.state = state;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.SingleValueDescribeData#getName()
-     */
     public String getName() {
         return this.name;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.SingleValueDescribeData#getValue()
-     */
     public String getValue() {
         return this.value;
     }
@@ -60,3 +60,4 @@
         return this.state;
     }
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -11,3 +11,4 @@
 public interface DescribeData extends Serializable {
 
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -3,6 +3,9 @@
 import org.apache.log4j.Logger;
 
 /**
+ * This implementation improves the <code>DefaultKeyValueDescribeData</code> and
+ * establishes another field to store a further parameter.
+ * 
  * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
  */
 public class ExtendedKeyValueData
@@ -10,9 +13,19 @@
 {
     private static Logger logger = Logger.getLogger(ExtendedKeyValueData.class);
 
+    /**
+     * A further parameter to be stored at this object.
+     */
     protected String parameter;
 
-
+    /**
+     * Default constructor to initialize new objects.
+     *
+     * @param key The key.
+     * @param value The value.
+     * @param state The state - null permitted.
+     * @param parameter A further value.
+     */
     public ExtendedKeyValueData(
         String key, String value, String state, String parameter)
     {
@@ -20,6 +33,11 @@
         this.parameter = parameter;
     }
 
+    /**
+     * Returns the parameter.
+     *
+     * @return the parameter.
+     */
     public String getParameter() {
         return parameter;
     }
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -3,19 +3,48 @@
 import java.io.Serializable;
 
 /**
+ * This interface defines some methods to retrieve a key-value pair, a state
+ * this data belongs to and a boolean property, if this data have been selected.
+ * 
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
- *
  */
 public interface KeyValueDescibeData extends Serializable {
 
+    /**
+     * Returns the key of this data object.
+     * 
+     * @return the key.
+     */
     public String getKey();
 
+    /**
+     * Returns the value of this data object.
+     *
+     * @return the value.
+     */
     public String getValue();
 
+    /**
+     * Returns the state of this data object.
+     *
+     * @return the state.
+     */
     public String getState();
 
+    /**
+     * Returns a boolean which defines, if this data pair has been selected or
+     * not.
+     *
+     * @return true, if this pair has been selected - otherwise false.
+     */
     public boolean isSelected();
 
+    /**
+     * Method to change the selection of this data object.
+     *
+     * @param selected Set this value to true, if you want to select this data
+     * object - set it to false, if you want to unselect it.
+     */
     public void setSelected(boolean selected);
-
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -1,24 +1,67 @@
 package de.intevation.gnv.state.describedata;
 
 /**
+ * This interface describes some methods to set and retrieve a min-max value
+ * pair with a specific name.
+ * 
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
- *
  */
 public interface MinMaxDescribeData extends DescribeData {
 
+    /**
+     * Returns the min value stored in this object.
+     *
+     * @return the min value.
+     */
     public Object getMinValue();
 
+    /**
+     * Returns the max value stored in this object.
+     *
+     * @return the max value.
+     */
     public Object getMaxValue();
 
+    /**
+     * Sets the min value in this object.
+     *
+     * @param minValue A new min value.
+     */
     public void setMinValue(Object minValue);
 
+    /**
+     * Sets the max value in this object.
+     *
+     * @param maxValue A new max value.
+     */
     public void setMaxValue(Object maxValue);
 
+    /**
+     * Returns the general name of this object.
+     *
+     * @return the name.
+     */
     public String getName();
 
+    /**
+     * Returns the name of the min value.
+     *
+     * @return the name of the min value.
+     */
     public String getMinName();
 
+    /**
+     * Returns the name of this max value.
+     *
+     * @return the name of the max value.
+     */
     public String getMaxName();
 
+    /**
+     * Returns the state this object belongs to.
+     *
+     * @return the state.
+     */
     public String getState();
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java	Fri Apr 09 07:27:38 2010 +0000
@@ -4,8 +4,10 @@
 import java.util.Collection;
 
 /**
+ * This is the default implementation of <code>NamedCollection</code>.
+ *
+ * @param <E> The type which the objects stored in this object are from.
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
- *
  */
 public class NamedArrayList<E> extends ArrayList<E> implements
                                                    NamedCollection<E> {
@@ -20,6 +22,8 @@
 
     /**
      * Constructor
+     *
+     * @param name The name of this collection.
      */
     public NamedArrayList(String name) {
         this.name = name;
@@ -28,7 +32,8 @@
     /**
      * Constructor
      *
-     * @param initialCapacity
+     * @param name The name of this collection.
+     * @param initialCapacity The initial capacity of this collection.
      */
     public NamedArrayList(String name, int initialCapacity) {
         super(initialCapacity);
@@ -38,31 +43,24 @@
     /**
      * Constructor
      *
-     * @param c
+     * @param name The name of this collection.
+     * @param c the collection whose elements are to be placed into this list.
      */
     public NamedArrayList(String name, Collection<E> c) {
         super(c);
         this.name = name;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.NamedCollection#getName()
-     */
     public String getName() {
         return this.name;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.NamedCollection#isMultiSelect()
-     */
     public boolean isMultiSelect() {
         return multiSelect;
     }
 
-    /**
-     * @see de.intevation.gnv.state.describedata.NamedCollection#setMultiSelect(boolean)
-     */
     public void setMultiSelect(boolean multiSelect) {
         this.multiSelect = multiSelect;
     }
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java	Fri Apr 09 07:27:38 2010 +0000
@@ -3,14 +3,36 @@
 import java.util.Collection;
 
 /**
+ * This interface describes some methods to retrieve the name of this <code>
+ * Collection</code> and to determine if this <code>Collection</code> is a
+ * single or multiselect object.
+ *
+ * @param <E> The objects in this class need to be of this type.
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
  *
  */
 public interface NamedCollection<E> extends Collection<E> {
 
+    /**
+     * Returns the name of this <code>Collection</code>.
+     *
+     * @return the name.
+     */
     public String getName();
 
+    /**
+     * Determines if this <code>Collection</code> is a multi select object.
+     *
+     * @return true, if it is multi select, otherwise false.
+     */
     public boolean isMultiSelect();
 
+    /**
+     * Change between single and multiselect.
+     *
+     * @param multiSelect true, if this object should be a multiselect,
+     * otherwise false.
+     */
     public void setMultiSelect(boolean multiSelect);
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java	Thu Apr 08 16:35:02 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java	Fri Apr 09 07:27:38 2010 +0000
@@ -1,16 +1,38 @@
 package de.intevation.gnv.state.describedata;
 
 /**
+ * This interface defines some methods to store and retrieve key-value pairs.
+ *
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
- *
  */
 public interface SingleValueDescribeData extends DescribeData {
 
+    /**
+     * Returns the name of this object.
+     *
+     * @return the name.
+     */
     public String getName();
 
+    /**
+     * Returns the value stored in this object.
+     *
+     * @return the value.
+     */
     public String getValue();
 
+    /**
+     * Sets the value of this object to <i>value</i>.
+     *
+     * @param value A new value.
+     */
     public void setValue(String value);
 
+    /**
+     * Returns the state this objects belongs to.
+     *
+     * @return the state.
+     */
     public String getState();
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file

http://dive4elements.wald.intevation.org