kiwi.util
Class StringUtils

java.lang.Object
  |
  +--kiwi.util.StringUtils

public final class StringUtils
extends java.lang.Object

A class of miscellaneous string utilities. All of the methods in this class are static.

Author:
Mark Lindner, PING Software Group

Constructor Summary
private StringUtils()
           
 
Method Summary
static java.lang.String getClassName(java.lang.Class clazz)
          Get the name of a class; this method returns the last component of the fully qualified name of the given class.
static boolean isAlphaNumeric(java.lang.String text)
          Determine if a string consists solely of alphanumeric characters.
static java.lang.String join(java.lang.String[] array, java.lang.String delimiter)
          Join an array of strings into a single string of tokens using the given delimiter.
static java.lang.String justify(java.lang.String text, int cols)
          Left justify a string, wrapping words as necessary.
static java.lang.String[] split(java.lang.String s, java.lang.String delimiter)
          Split a string into a series of tokens based on the given delimiter.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

StringUtils

private StringUtils()
Method Detail

justify

public static final java.lang.String justify(java.lang.String text,
                                             int cols)
Left justify a string, wrapping words as necessary.
Parameters:
text - The text to justify.
cols - The number of columns to use.

isAlphaNumeric

public static final boolean isAlphaNumeric(java.lang.String text)
Determine if a string consists solely of alphanumeric characters.
Parameters:
text - The string to test.
Returns:
true if the string contains only alphanumeric characters, and false otherwise.

split

public static final java.lang.String[] split(java.lang.String s,
                                             java.lang.String delimiter)
Split a string into a series of tokens based on the given delimiter.
Parameters:
s - The string to split.
delimiter - A string consisting of characters that should be treated as delimiters.
Returns:
An array of tokens.
See Also:
join(java.lang.String[], java.lang.String)

join

public static final java.lang.String join(java.lang.String[] array,
                                          java.lang.String delimiter)
Join an array of strings into a single string of tokens using the given delimiter.
Parameters:
array - The tokens to join.
delimiter - A string to insert between adjacent tokens.
Returns:
The resulting string.
See Also:
split(java.lang.String, java.lang.String)

getClassName

public static final java.lang.String getClassName(java.lang.Class clazz)
Get the name of a class; this method returns the last component of the fully qualified name of the given class. For example, 'String' is returned for the class java.lang.String.
Parameters:
clazz - The class.
Returns:
The name of the class.