diff gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java @ 806:2cea76f1112e

Added Javadoc in utils package. gnv-artifacts/trunk@888 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 08 Apr 2010 13:10:39 +0000
parents feae2f9d6c6f
children 05bf8534a35a
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java	Thu Apr 08 11:31:44 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java	Thu Apr 08 13:10:39 2010 +0000
@@ -38,6 +38,16 @@
         super();
     }
 
+    /**
+     * Validates the input of a range of double or date values. The input values
+     * need to be valid double or date values. <i>minInput</i> needs to be
+     * smaller or equal <i>maxInput</i>.
+     *
+     * @param minInput The lower bound.
+     * @param maxInput The upper bound.
+     * @param type One of 'Date' or 'Double'.
+     * @return true, if the input is valid, otherwise false.
+     */
     public static boolean isInputValid(String minInput, String maxInput, String type) {
         log.debug("InputValidator.isInputValid " + minInput + " " + maxInput + " " +type);
         boolean returnValue = false;
@@ -63,6 +73,13 @@
         return returnValue;
     }
 
+    /**
+     * Validates an input.
+     *
+     * @param input The input value.
+     * @param type The input value type.
+     * @return true if the input is valid, otherwise false.
+     */
     public static boolean isInputValid(String input, String type) {
         log.debug("InputValidator.isInputValid " + input + " " + type);
 
@@ -135,6 +152,13 @@
     }
 
 
+    /**
+     * Returns a point from wkt string.
+     *
+     * @param value The wkt string.
+     * @return a point.
+     * @throws ValidationException if <i>value</i> is not valid.
+     */
     public static Point getPointValue(String value) throws ValidationException{
         log.debug("InputValidator.getPointValue " + value);
 
@@ -184,6 +208,14 @@
     }
 
 
+    /**
+     * Makes sure that <i>tmp</i> is between <i>lo</i> and <i>up</i>.
+     *
+     * @param tmp The value to validate.
+     * @param lo The lower range bound.
+     * @param up The upper range bound.
+     * @return true, if tmp is valid, otherwise false.
+     */
     public static boolean isDateValid(Date tmp, Date lo, Date up) {
         // we need to transform the given dates into seconds, because
         // they differ in milliseconds -> that's why we cannot use the
@@ -202,3 +234,4 @@
         return true;
     }
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file

http://dive4elements.wald.intevation.org