org.jwaf.util
Class StringHandler

java.lang.Object
  |
  +--org.jwaf.util.StringHandler

public class StringHandler
extends java.lang.Object

Helps in manipulating and formatting strings


Constructor Summary
StringHandler()
           
 
Method Summary
static java.lang.String getDisplayTime(int totalSeconds)
          Gets time in hours / minutes / secs from totalSeconds
static boolean isEmptyString(java.lang.String string)
          Gets the EmptyString attribute of the StringHandler class
static java.lang.String plural(int number)
          Return an "s" if number is greater than 1
static java.lang.String removeCharacter(java.lang.String source, char character)
          Remove all characters in character from source
static java.lang.String removeCharacters(java.lang.String source, java.lang.String characters)
          Remove a character from a string
static java.lang.String replaceKeyValue(java.lang.String source, java.lang.String key, java.lang.String value)
          Replace all occurences of key with value in the source string
static java.lang.String substituteKeys(java.lang.String source, java.util.Hashtable replaceTable)
          Replace all keys in source based on the keys and values in replaceTable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringHandler

public StringHandler()
Method Detail

getDisplayTime

public static java.lang.String getDisplayTime(int totalSeconds)
Gets time in hours / minutes / secs from totalSeconds
Parameters:
totalSeconds -  
Returns:
The DisplayTime value

plural

public static java.lang.String plural(int number)
Return an "s" if number is greater than 1
Parameters:
number -  
Returns:
 

isEmptyString

public static boolean isEmptyString(java.lang.String string)
Gets the EmptyString attribute of the StringHandler class
Parameters:
string -  
Returns:
The EmptyString value

removeCharacters

public static java.lang.String removeCharacters(java.lang.String source,
                                                java.lang.String characters)
Remove a character from a string
Parameters:
source -  
characters -  
Returns:
 

removeCharacter

public static java.lang.String removeCharacter(java.lang.String source,
                                               char character)
Remove all characters in character from source
Parameters:
source -  
character -  
Returns:
 

replaceKeyValue

public static java.lang.String replaceKeyValue(java.lang.String source,
                                               java.lang.String key,
                                               java.lang.String value)
Replace all occurences of key with value in the source string
Parameters:
source -  
key -  
value -  
Returns:
 

substituteKeys

public static java.lang.String substituteKeys(java.lang.String source,
                                              java.util.Hashtable replaceTable)
Replace all keys in source based on the keys and values in replaceTable
Parameters:
source -  
replaceTable -  
Returns: