Merge pull request #68 from ljacqu/master

Revert certain JavaDoc changes
This commit is contained in:
Tim Visée
2015-11-21 16:57:17 +01:00
5 changed files with 89 additions and 159 deletions
@@ -5,17 +5,18 @@ import net.ricecode.similarity.StringSimilarityService;
import net.ricecode.similarity.StringSimilarityServiceImpl;
/**
* Utility class for String operations.
*/
public class StringUtils {
/**
* Get the difference of two strings.
*
* @param first First string.
* @param second Second string.
* @param first First string
* @param second Second string
*
* @return The difference value. */
* @return The difference value
*/
public static double getDifference(String first, String second) {
// Make sure the strings are valid.
if(first == null || second == null)
@@ -27,22 +28,25 @@ public class StringUtils {
// Determine the difference value, return the result
return Math.abs(service.score(first, second) - 1.0);
}
/**
* Method containsAny.
* @param str String
* @param pieces String[]
* @return boolean */
* Returns whether the given string contains any of the provided elements.
*
* @param str the string to analyze
* @param pieces the items to check the string for
*
* @return true if the string contains at least one of the items
*/
public static boolean containsAny(String str, String... pieces) {
if (str == null) {
return false;
}
for (String piece : pieces) {
if (str.contains(piece)) {
if (piece != null && str.contains(piece)) {
return true;
}
}
return false;
}
}