org.gjt.rec.util
Class Stringz

java.lang.Object
  |
  +--org.gjt.rec.util.Stringz

public final class Stringz
extends Object


Field Summary
static String REVISION
           
 
Method Summary
static String join(Collection elements, String delimiter)
          Joins the string representations of a Collection of objects (which might just be strings) into a single string with each element separated by (delimiter).
static String lowerCaseInitial(String str)
           
static Collection split(String str, String delimiters)
          Splits a string into an ordered collection of token strings where each token is separated from the others by one or more characters in (delimiters).
static String[] splitToArray(String str, String delimiters)
          Functionally, this method is the same as split(str, delimiters).toArray(), but this implementation is faster and thrashes the heap less.
static String upperCaseInitial(String str)
           
static String valueOf(Object obj)
          This method behaves much like String.valueOf(Object) except that it augments the output of many platform classes that have toString() implementations that are broken for debugging purpose, such as java.beans.PropertyChangeEvent, which dumps the source object, but none of the other properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REVISION

public static final String REVISION
See Also:
Constant Field Values
Method Detail

lowerCaseInitial

public static String lowerCaseInitial(String str)

upperCaseInitial

public static String upperCaseInitial(String str)

join

public static String join(Collection elements,
                          String delimiter)
Joins the string representations of a Collection of objects (which might just be strings) into a single string with each element separated by (delimiter).

Parameters:
elements - a collection of elements to join
delimiter - the delimiter to use to separate each element
Throws:
NullPointerException - if either argument is null

split

public static Collection split(String str,
                               String delimiters)
Splits a string into an ordered collection of token strings where each token is separated from the others by one or more characters in (delimiters).

The order of the collection is determined by the order of the elements in (str).

Parameters:
str - the string to split
delimiters - the set of delimiter characters
Returns:
an ordered collection of string tokens
Throws:
NullPointerException - if either argument is null

splitToArray

public static String[] splitToArray(String str,
                                    String delimiters)
Functionally, this method is the same as split(str, delimiters).toArray(), but this implementation is faster and thrashes the heap less. Adjacent delimiters count as a single delimiter


valueOf

public static String valueOf(Object obj)
This method behaves much like String.valueOf(Object) except that it augments the output of many platform classes that have toString() implementations that are broken for debugging purpose, such as java.beans.PropertyChangeEvent, which dumps the source object, but none of the other properties.

Parameters:
obj - the object for which to obtain a debug string
Returns:
the debug string for the specified object