|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.could.util.StringTools
An utility class providing various static methods operating on
String
s.
This class implement the Encodable
interface from which it
inherits its default encoding
.
Method Summary | |
static int |
findFirst(String source,
String delimiters)
Find the first occurrence of one of the specified delimiter characters in the specified source string. |
static String |
formatHttpDate(Date date)
Format a Date according to the HTTP/1.1 RFC. |
static String |
formatIsoDate(Date date)
Format a Date according to the ISO 8601 specification. |
static String |
formatNumber(Number number)
Format a Number into a String making sure that
NullPointerException s are not thrown. |
static Date |
parseHttpDate(String string)
Parse a String into a Date according to the
HTTP/1.1 RFC (Mon, 31 Jan 2000 11:59:00 GMT ). |
static Date |
parseIsoDate(String string)
Parse a String into a Date according to the ISO 8601
specification (2000-12-31T11:59:00Z ). |
static Long |
parseNumber(String string)
Parse a String into a Long . |
static String[] |
splitAll(String source,
char delimiter)
Split the specified string according to the specified delimiter, and any resulting path of zero length will be converted to null. |
static String[] |
splitOnce(String source,
char delimiter,
boolean noDelimReturnSecond)
Split the specified string in two parts according to the specified delimiter, and any resulting path of zero length will be converted to null. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static String formatNumber(Number number)
Format a Number
into a String
making sure that
NullPointerException
s are not thrown.
number
- the Number
to format.
String
instance or null if the object was null.public static Long parseNumber(String string)
string
- the String
to parse.
Long
instance or null if the date was null or
if there was an error parsing the specified String
.public static String formatHttpDate(Date date)
Format a Date
according to the HTTP/1.1 RFC.
date
- the Date
to format.
String
instance or null if the date was null.public static String formatIsoDate(Date date)
Format a Date
according to the ISO 8601 specification.
date
- the Date
to format.
String
instance or null if the date was null.public static Date parseHttpDate(String string)
Parse a String
into a Date
according to the
HTTP/1.1 RFC (Mon, 31 Jan 2000 11:59:00 GMT
).
string
- the String
to parse.
Date
instance or null if the date was null or
if there was an error parsing the specified String
.public static Date parseIsoDate(String string)
Parse a String
into a Date
according to the ISO 8601
specification (2000-12-31T11:59:00Z
).
string
- the String
to parse.
Date
instance or null if the date was null or
if there was an error parsing the specified String
.public static String[] splitOnce(String source, char delimiter, boolean noDelimReturnSecond)
Split the specified string in two parts according to the specified delimiter, and any resulting path of zero length will be converted to null.
public static String[] splitAll(String source, char delimiter)
Split the specified string according to the specified delimiter, and any resulting path of zero length will be converted to null.
public static int findFirst(String source, String delimiters)
Find the first occurrence of one of the specified delimiter characters in the specified source string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |