|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.sfac.string.StringUtils
public abstract class StringUtils
String manipulation/comparison utility class.
| Constructor Summary | |
|---|---|
StringUtils()
|
|
| Method Summary | |
|---|---|
static boolean |
areEquals(CharIterator it1,
CharIterator it2,
boolean normalized)
Check if the content of the two iterators is the same. |
static String |
firstOfWordsUpperCase(String src)
Transform the string to have the first character of each word in uppercase. |
static String |
firstOfWordsUpperCase(String src,
boolean othersToLowercase)
Transform the string to have the first character of each word in uppercase. |
static String |
firstToLowerCase(String src)
|
static String |
firstToUpperCase(String src)
|
static String |
getEncodedString(String src)
Encode a string to avoid spaces and non-alphanumeric characters. |
static String[] |
getNormalizedKeywords(String keywordString)
|
static String |
getNormalizedString(String src)
Normalize a string. |
static char |
getUppercaseChar(char ch)
Get the uppercase char corresponding to the given character with removed diacritic mark. |
static boolean |
matchKeywords(String keywords,
boolean matchAll,
CharIterator src)
Check if all/any of the given keywords are contained in the iterator. |
static boolean |
matchNormalizedKeywords(String[] keywords,
boolean matchAll,
CharIterator src)
Check if all/any of the given keywords are contained in the iterator. |
static boolean |
matchPattern(String pattern,
CharIterator src)
Check if the given pattern is contained in the iterator. |
static boolean |
matchString(String pattern,
CharIterator src,
boolean ignoreCase)
Check if the string is contained in the iterator. |
static char |
removeDiacritic(char ch)
Get the equivalent char with removed diacritic marks (like accents, cedillas, dots, tildes ...). |
| 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 boolean matchString(String pattern,
CharIterator src,
boolean ignoreCase)
pattern - the pattern to find in the char iterator.src - A CharIterator on the text to search.
public static boolean matchPattern(String pattern,
CharIterator src)
pattern - the pattern to find in the char iterator.src - A CharIterator on the text to search.
public static boolean areEquals(CharIterator it1,
CharIterator it2,
boolean normalized)
normalized is true, the iterators content will be
normalized and trimmed for comparison.
it1 - first char iterator.it2 - second char iterator.normalized - true content should be normalized for comparison.
public static boolean matchKeywords(String keywords,
boolean matchAll,
CharIterator src)
keywords - String containing list of keyword to compare.matchAll - true if all the keyword have to be matched, false if only one of the keywords have to be matched.src - A CharIteraor on the text to search.
public static String[] getNormalizedKeywords(String keywordString)
public static boolean matchNormalizedKeywords(String[] keywords,
boolean matchAll,
CharIterator src)
keywords - String containing list of keyword to compare.matchAll - true if all the keyword have to be matched, false if only one of the keywords have to be matched.src - A CharIteraor on the text to search.
public static String getNormalizedString(String src)
src - Source string
public static final char removeDiacritic(char ch)
ch - the possibly accentued char to convert.
public static final char getUppercaseChar(char ch)
Character.toUpperCase implementation
transforms '�' to '�', '�' to '�' ...
ch - the character.
public static final String firstToUpperCase(String src)
public static final String firstToLowerCase(String src)
public static final String firstOfWordsUpperCase(String src)
src - source string
public static final String firstOfWordsUpperCase(String src,
boolean othersToLowercase)
src - source stringothersToLowercase - if true, the characters that are not the first of a word are forced to lowercase, otherwise they are left
unchanged.
public static final String getEncodedString(String src)
src - the soure string
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||