diff gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.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 c4156275c1e1
children a645bd23c1c8
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.java	Thu Apr 08 11:31:44 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.java	Thu Apr 08 13:10:39 2010 +0000
@@ -6,6 +6,8 @@
 import java.util.List;
 
 /**
+ * A helper class to calculate distances between points and coordinates.
+ * 
  * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a>
  *
  */
@@ -21,10 +23,26 @@
     public DistanceCalculator() {
     }
 
+
+    /**
+     * Calculates the distance between two points.
+     *
+     * @param p1 First point.
+     * @param p2 Second point.
+     * @return the distance.
+     */
     public static double calculateDistance(Point p1, Point p2){
         return calculateDistance(p1.getCoordinate(), p2.getCoordinate());
     }
 
+
+    /**
+     * Calculates the distance between two coordinates.
+     *
+     * @param p1 First coordinate.
+     * @param p2 Second coordinate.
+     * @return the distance.
+     */
     public static double calculateDistance(Coordinate p1, Coordinate p2){
         double resultValue = 0.0;
 
@@ -66,6 +84,12 @@
         return resultValue;
     }
 
+    /**
+     * Calculates the length of a path specified by coordinates in <i>path</i>.
+     *
+     * @param path A list of coordinates.
+     * @return the length of the given path.
+     */
     public static final double calculateDistance(List<Coordinate> path) {
         int N = path.size();
         if (N < 2) {
@@ -79,3 +103,4 @@
     }
 
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
\ No newline at end of file

http://dive4elements.wald.intevation.org