commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brit...@apache.org
Subject [4/8] [text] Better JavaDoc for HammingDistance
Date Sun, 14 Dec 2014 20:41:23 GMT
Better JavaDoc for HammingDistance


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/5fce7f89
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/5fce7f89
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/5fce7f89

Branch: refs/heads/master
Commit: 5fce7f89410b76cd5558eb9240b1f4d58ce1cd15
Parents: 22e64f0
Author: Benedikt Ritter <britter@apache.org>
Authored: Sun Dec 14 21:27:04 2014 +0100
Committer: Benedikt Ritter <britter@apache.org>
Committed: Sun Dec 14 21:27:04 2014 +0100

----------------------------------------------------------------------
 .../commons/text/similarity/HammingDistance.java   | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/5fce7f89/src/main/java/org/apache/commons/text/similarity/HammingDistance.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/similarity/HammingDistance.java b/src/main/java/org/apache/commons/text/similarity/HammingDistance.java
index c7a1d63..eb21307 100644
--- a/src/main/java/org/apache/commons/text/similarity/HammingDistance.java
+++ b/src/main/java/org/apache/commons/text/similarity/HammingDistance.java
@@ -17,26 +17,27 @@
 package org.apache.commons.text.similarity;
 
 /**
- * <p>
  * The hamming distance between two strings of equal length is the number of
  * positions at which the corresponding symbols are different.
- * </p>
  *
  * <p>
- * For further explanation about the hamming distance, take a look at its
+ * For further explanation about the Hamming Distance, take a look at its
  * Wikipedia page at http://en.wikipedia.org/wiki/Hamming_distance.
  * </p>
  */
 public class HammingDistance implements StringMetric<Integer> {
 
     /**
-     * <p>Find the hamming distance between two strings with the same
-     * length.</p>
+     * Find the Hamming Distance between two strings with the same
+     * length.
      *
      * <p>The distance starts with zero, and for each occurrence of a
      * different character in either String, it increments the distance
      * by 1, and finally return its value.</p>
      *
+     * <p>Since the Hamming Distance can only be calculated between strings of equal
length, input of different lengths
+     * will throw IllegalArgumentException</p>
+     *
      * <pre>
      * distance.compare("", "")               = 0
      * distance.compare("pappa", "pappa")     = 0
@@ -45,10 +46,10 @@ public class HammingDistance implements StringMetric<Integer> {
      * distance.compare("karolin", "kerstin"  = 3
      * </pre>
      *
-     * @param left the first string, must not be null
-     * @param right the second string, must not be null
+     * @param left the first CharSequence, must not be null
+     * @param right the second CharSequence, must not be null
      * @return distance
-     * @throws IllegalArgumentException if either String input {@code null} or
+     * @throws IllegalArgumentException if either input is {@code null} or
      *             if they do not have the same length
      */
     @Override


Mime
View raw message