|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.architecture.traffic.util.StringUtils
public class StringUtils
Auxiliary class for processing strings. Used mainly by the XML parser
| Constructor Summary | |
|---|---|
StringUtils()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
firstLetterToUpperCase(java.lang.String string)
Convert the first letter of a string to upper case and return the result |
static int |
getIndexObject(java.lang.Object[] data,
java.lang.Object object)
Find the index of an element in an array. |
static java.lang.Object |
lookUpNumber(java.lang.Object[] data,
int index)
Lookup an element in an array |
static java.lang.String |
remove(java.lang.String string,
char o)
Remove all occurences of a char from a string |
static java.lang.String |
remove(java.lang.String string,
java.lang.String o)
Remove all occurences of a string from another string |
static java.lang.String |
repeat(char c,
int times)
Fill a string with several occurences of a char |
static java.lang.String |
replace(java.lang.String string,
char o,
char n)
Replace a char in a string with another char |
static java.lang.String |
replace(java.lang.String string,
char o,
java.lang.String n)
Replace all occurences of a char in a String with a string |
static java.lang.String |
replace(java.lang.String string,
java.lang.String o,
java.lang.String n)
Replace all occurences of a string in another String |
static java.lang.String |
replaceList(java.lang.String string,
char[] from,
java.lang.String[] to)
Replace instances of chars in the from-array in the first string with their counterpart in the to-array. |
static java.lang.String |
replaceList(java.lang.String string,
java.lang.String[] from,
java.lang.String[] to)
Replace instances of strings in the from-array in the first string with their counterpart in the to-array. |
| 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 java.lang.String replaceList(java.lang.String string,
java.lang.String[] from,
java.lang.String[] to)
string - The input stringfrom - The first column of the translation table (The strings to
replace).to - The second column of the translation table (The strings to
replace the elements of the from array with).
public static java.lang.String replaceList(java.lang.String string,
char[] from,
java.lang.String[] to)
string - The input stringfrom - The first column of the translation table (The chars to
replace).to - The second column of the translation table (The strings to
replace the elements of the from array with).
public static java.lang.String replace(java.lang.String string,
java.lang.String o,
java.lang.String n)
string - The string to search ino - the old substringn - the string with which o has to be replaced
public static java.lang.String replace(java.lang.String string,
char o,
java.lang.String n)
string - The string to search ino - the old charn - the new string to replace the char with
public static java.lang.String replace(java.lang.String string,
char o,
char n)
string - The string to search ino - the old charn - the new char with which the old char is to be replaced
public static java.lang.String remove(java.lang.String string,
char o)
string - The string to search ino - the char to remove
public static java.lang.String remove(java.lang.String string,
java.lang.String o)
string - The string to search ino - the string to remove
public static java.lang.String repeat(char c,
int times)
c - The char to fill the string withtimes - The length of the string
public static java.lang.String firstLetterToUpperCase(java.lang.String string)
string - The input string
public static java.lang.Object lookUpNumber(java.lang.Object[] data,
int index)
data - The array to search inindex - The index of the element you want
java.util.NoSuchElementException - If the array has no element at the
specified index.
public static int getIndexObject(java.lang.Object[] data,
java.lang.Object object)
data - The array to search inobject - The element to search for
java.util.NoSuchElementException - If the specified object cannot be found
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||