|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdirk_krause.jtools.StringTool
public class StringTool
The static methods of the StringTool class can be used to convert strings to integer, colors and booleans.
Field Summary | |
---|---|
static java.lang.String[] |
theBooleanStrings
Strings which can be converted into booleans. |
Constructor Summary | |
---|---|
StringTool()
|
Method Summary | |
---|---|
static int |
getArrayIndex(java.lang.String[] a,
java.lang.String s)
Find index of string s in array a. |
static boolean |
getBoolean(java.lang.String s,
boolean d)
Convert a string into a boolean. |
static java.awt.Color |
getColor(java.lang.String s)
Convert a String into a color. |
static java.awt.Color |
getColor(java.lang.String s,
int dr,
int dg,
int db)
Convert string into a color. |
static int |
getIntValue(java.lang.String s)
Parse string for integer value. |
static int |
getIntValue(java.lang.String s,
int d)
Parse string for integer value. |
static int |
getStartArrayIndex(java.lang.String[] a,
java.lang.String s)
Check whether or not the string s starts with one of the strings from the array a. |
static boolean |
isBoolean(java.lang.String s)
Check whether or not a string represents a boolean. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String[] theBooleanStrings
Constructor Detail |
---|
public StringTool()
Method Detail |
---|
public static int getIntValue(java.lang.String s, int d)
s
- The string to parse.d
- A default value.
public static int getIntValue(java.lang.String s)
s
- The string to parse.
public static java.awt.Color getColor(java.lang.String s, int dr, int dg, int db)
s
- A string like "128,0,0".dr
- Default for red.dg
- Default for green.db
- Default for blue.
public static java.awt.Color getColor(java.lang.String s)
s
- The string to analyze.
public static int getArrayIndex(java.lang.String[] a, java.lang.String s)
a
- An array of strings.s
- The string to search for.
public static int getStartArrayIndex(java.lang.String[] a, java.lang.String s)
a
- An array of strings, one of the strings is probably
at the start of string s.s
- The string to check.
public static boolean isBoolean(java.lang.String s)
s
- The string to check.
public static boolean getBoolean(java.lang.String s, boolean d)
s
- The source string.d
- A default value, returned if the string does
not represent a boolean.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |