|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.client.utils.StringUtils
public class StringUtils
| Nested Class Summary | |
|---|---|
static interface |
StringUtils.Collator
|
static class |
StringUtils.CollatorFFandIE
|
static class |
StringUtils.CollatorSafari
|
| Constructor Summary | |
|---|---|
StringUtils()
|
|
| Method Summary | |
|---|---|
static int |
charCodeAt(String str,
int i)
|
static boolean |
containsValue(String multiValuedProperty,
String value)
|
static boolean |
equals(String a,
String b)
This method generates a faster string comparison than String.equals()
for web mode code. |
static int |
getLevenshteinDistance(String s,
String t)
Find the Levenshtein distance between two Strings. |
static boolean |
isEmpty(String value)
|
static boolean |
isNumeric(String str)
|
static boolean |
isWhitespace(char c)
|
static int |
localeCompare(String source,
String target)
|
static int |
localeCompare(String source,
String target,
boolean caseSensitive)
|
static String |
lpad(String src,
int length,
char padding)
|
static String |
removeAccents(String value)
|
static String |
replace(String text,
String searchString,
String replacement)
|
static String |
replace(String text,
String searchString,
String replacement,
int max)
|
static String |
rpad(String src,
int length,
char padding)
|
static String |
rTrim(String value)
|
static double |
safeParseDouble(String value)
|
static String |
toHEXString(String input)
Convert a raw UTF-8 string to a hex string. |
static String |
toUpperCaseFirstChar(String text)
Transforms "some text" into "Some text" |
static String |
toUTF8(String utf16String)
Encode an UTF-16 string (Unicode) to UTF-8. |
static boolean |
unsafeEquals(String a,
String b)
This method generate a faster string comparison than String.equals()
for web mode code. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringUtils()
| Method Detail |
|---|
public static int localeCompare(String source,
String target)
public static int localeCompare(String source,
String target,
boolean caseSensitive)
public static String removeAccents(String value)
public static String lpad(String src,
int length,
char padding)
src - length - padding -
public static String rpad(String src,
int length,
char padding)
src - length - padding -
public static boolean isEmpty(String value)
value -
public static String replace(String text,
String searchString,
String replacement)
text - searchString - replacement -
public static String replace(String text,
String searchString,
String replacement,
int max)
text - searchString - replacement - max -
public static String toUpperCaseFirstChar(String text)
text -
public static boolean equals(String a,
String b)
String.equals()
for web mode code.
The GWT generated String.equals() method makes a check in its parameter's type in runtime.
That method makes that assertion on compilation time (once its parameters are both
Strings).
a - b -
public static boolean unsafeEquals(String a,
String b)
String.equals()
for web mode code. It is similar to StringUtils.equals() method.
The only difference is that this one does not check for null parameters.
a - b -
public static double safeParseDouble(String value)
value -
public static boolean containsValue(String multiValuedProperty,
String value)
multiValuedProperty - value -
public static String rTrim(String value)
public static boolean isWhitespace(char c)
public static int getLevenshteinDistance(String s,
String t)
Find the Levenshtein distance between two Strings.
StringUtils.getLevenshteinDistance(null, *) = IllegalArgumentException
StringUtils.getLevenshteinDistance(*, null) = IllegalArgumentException
StringUtils.getLevenshteinDistance("","") = 0
StringUtils.getLevenshteinDistance("","a") = 1
StringUtils.getLevenshteinDistance("aaapppp", "") = 7
StringUtils.getLevenshteinDistance("frog", "fog") = 1
StringUtils.getLevenshteinDistance("fly", "ant") = 3
StringUtils.getLevenshteinDistance("elephant", "hippo") = 7
StringUtils.getLevenshteinDistance("hippo", "elephant") = 7
StringUtils.getLevenshteinDistance("hippo", "zzzzzzzz") = 8
StringUtils.getLevenshteinDistance("hello", "hallo") = 1
s - the first String, must not be nullt - the second String, must not be null
IllegalArgumentException - if either String input nullpublic static boolean isNumeric(String str)
public static int charCodeAt(String str,
int i)
public static String toUTF8(String utf16String)
utf16String -
public static String toHEXString(String input)
input -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||