|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.ontopia.utils.StringUtils
public class StringUtils
INTERNAL: Class that contains useful string operation methods.
Field Summary | |
---|---|
static String |
VERY_UNLIKELY_STRING
INTERNAL: A string used internally for various control flow purposes. |
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static int |
compare(String s1,
String s2)
INTERNAL: Compare two string values lexically. |
static int |
compareToIgnoreCase(String s1,
String s2)
INTERNAL: Compare two string values lexically ignoring case. |
static void |
downCaseAscii(char[] ch,
int start,
int length)
INTERNAL: Convert the A-Z characters in the array region to a-z. |
static String |
escapeHTMLEntities(String value)
INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, returning the string with these characters replaced by the corresponding character entities. |
static void |
escapeHTMLEntities(String value,
Writer out)
INTERNAL: Filters the specified string for characters that are senstive to HTML interpreters, writing the string with these characters replaced by the corresponding character entities to the given writer. |
static boolean |
isInteger(String candidate)
INTERNAL: Returns true if the string is a valid integer. |
static String |
join(boolean[] vals,
String separator)
INTERNAL: Joins the booleans in an array (turned into strings by toString) with a separator string. |
static String |
join(byte[] vals,
String separator)
INTERNAL: Joins the bytes in an array (turned into strings by toString) with a separator string. |
static String |
join(char[] vals,
String separator)
INTERNAL: Joins the characters in an array (turned into strings by toString) with a separator string. |
static String |
join(Collection objects,
String separator)
INTERNAL: Joins the objects in a collection (turned into strings by toString) with a separator string. |
static void |
join(Collection objects,
String separator,
StringBuffer sb)
INTERNAL: Joins the objects in a collection (turned into strings by toString) with a separator string. |
static String |
join(Collection objects,
String separator,
StringifierIF stringifier)
INTERNAL: Joins the objects in a collection (turned into strings by the stringifier) with a separator string. |
static String |
join(int[] vals,
String separator)
INTERNAL: Joins the ints in an array (turned into strings by toString) with a separator string. |
static String |
join(long[] vals,
String separator)
INTERNAL: Joins the longs in an array (turned into strings by toString) with a separator string. |
static String |
join(Object[] objects,
char separator)
INTERNAL: Joins the objects in an array (turned into strings by toString) with a separator string. |
static String |
join(Object[] objects,
String separator)
INTERNAL: Joins the objects in an array (turned into strings by toString) with a separator string. |
static String |
join(Object[] objects,
String separator,
boolean remove_nulls)
INTERNAL: Joins the non-null objects in an array (turned into strings by toString) with a separator string. |
static void |
join(Object[] objects,
String separator,
StringBuffer sb)
INTERNAL: Joins the objects in an array (turned into strings by toString) with a separator string. |
static String |
makeRandomId(int length)
INTERNAL: Make a random ID-like string of the given number of characters. |
static String |
md5_32(String value)
INTERNAL: Returns a 32 character long hex encoded MD5 digest of the given string. |
static String |
normalizeId(String name)
INTERNAL: Creates a candidate ID from an input string. |
static String |
normalizeIsWhitespace(String source)
INTERNAL: Replaces sequences of one or more characters that report as whitespace through Character.isWhitespace(char) by a single space, returning the new string. |
static String |
normalizeWhitespace(String source)
INTERNAL: Replaces sequences of one or more ' ', \t, \n, \r by a single space, returning the new string. |
static String |
pad(int number,
char ch,
int length)
INTERNAL: Pad characters to the given length. |
static String |
pad(String str,
char ch,
int length)
INTERNAL: Pad with filler characters in front of a base string to get the given length. |
static boolean |
regionEquals(String str,
char[] ch,
int start,
int length)
INTERNAL: Test whether the string is equal to the given region of the character array. |
static String |
replace(String str,
char oldvalue,
String newvalue)
INTERNAL: Replaces occurrences of a char within a string, returning a new string where the substitutions have been performed. |
static String |
replace(String str,
String oldvalue,
String newvalue)
INTERNAL: Replaces occurrences of a string within a string, returning a new string where the substitutions have been performed. |
static String[] |
split(String str)
INTERNAL: Splits a string on occurrences of a given substring. |
static String[] |
split(String str,
String separator)
INTERNAL: Splits a string on occurrences of a given substring. |
static String[] |
tokenize(String str,
String delimiters)
INTERNAL: Tokenizes a string on occurrences of a delimiters. |
static String |
transcode(String original,
String encoding)
INTERNAL: Transcode a string mistakenly interpreted as ISO 8859-1 to one interpreted as something else. |
static String |
transcodeUTF8(String original)
INTERNAL: Transcode a string mistakenly interpreted as ISO 8859-1 to one interpreted as UTF-8. |
static String[] |
trim(String[] str)
INTERNAL: Trims each individual string in the array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VERY_UNLIKELY_STRING
Constructor Detail |
---|
public StringUtils()
Method Detail |
---|
public static String replace(String str, String oldvalue, String newvalue)
public static String replace(String str, char oldvalue, String newvalue)
public static String[] split(String str)
public static String[] split(String str, String separator)
public static String[] tokenize(String str, String delimiters)
public static String[] trim(String[] str)
public static String join(Collection objects, String separator)
public static String join(Collection objects, String separator, StringifierIF stringifier)
public static String join(Object[] objects, String separator)
public static String join(Object[] objects, char separator)
public static String join(int[] vals, String separator)
public static String join(long[] vals, String separator)
public static String join(boolean[] vals, String separator)
public static String join(byte[] vals, String separator)
public static String join(char[] vals, String separator)
public static void join(Collection objects, String separator, StringBuffer sb)
public static void join(Object[] objects, String separator, StringBuffer sb)
public static String join(Object[] objects, String separator, boolean remove_nulls)
public static int compare(String s1, String s2)
public static int compareToIgnoreCase(String s1, String s2)
public static String normalizeWhitespace(String source)
public static String normalizeIsWhitespace(String source)
public static boolean regionEquals(String str, char[] ch, int start, int length)
public static void downCaseAscii(char[] ch, int start, int length)
public static String transcodeUTF8(String original)
public static String transcode(String original, String encoding) throws UnsupportedEncodingException
UnsupportedEncodingException
public static String escapeHTMLEntities(String value)
value
- The string to be filtered and returnedpublic static void escapeHTMLEntities(String value, Writer out) throws IOException
value
- The string to be filtered and written.
IOException
public static String makeRandomId(int length)
public static String pad(int number, char ch, int length)
public static String pad(String str, char ch, int length)
public static String md5_32(String value)
public static boolean isInteger(String candidate)
public static String normalizeId(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |