Mp3dings 
20100427

net.sourceforge.mp3dings.utils
Class CaseChanger

java.lang.Object
  extended by net.sourceforge.mp3dings.utils.CaseChanger

public class CaseChanger
extends Object

Static class that provides a method to change the case of a string.

Version:
$Revision: 1.22 $ ($Date: 2007/01/17 17:47:30 $)
Author:
Moritz Ringler

Field Summary
static int LOWER
          Lowercase
static int NO_CHANGE
           
static int UPPER
          Uppercase
static int UPPER_EACH_FIRST
          First letter of each word uppercase
static int UPPER_FIRST
          First letter of string uppercase
 
Method Summary
static String[] changeCase(String[] input, int mode)
          Changes the case of the specified strings.
static String[] changeCase(String[] input, String[] output, int mode)
          Changes the case of the specified strings.
static String changeCase(String input, int mode)
          Changes the case of the specified string
static String getModeName(int mode)
          Gets the name of a case changing mode
static String[] getModeNames()
          Gets the names of all available case changing modes.
static int getNumModes()
          Gets the number of available case changing modes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_CHANGE

public static final int NO_CHANGE
See Also:
Constant Field Values

LOWER

public static final int LOWER
Lowercase

See Also:
Constant Field Values

UPPER

public static final int UPPER
Uppercase

See Also:
Constant Field Values

UPPER_FIRST

public static final int UPPER_FIRST
First letter of string uppercase

See Also:
Constant Field Values

UPPER_EACH_FIRST

public static final int UPPER_EACH_FIRST
First letter of each word uppercase

See Also:
Constant Field Values
Method Detail

getModeName

public static String getModeName(int mode)
Gets the name of a case changing mode

Parameters:
mode - by default one of LOWER, UPPER, UPPER_FIRST or UPPER_EACH_FIRST
Returns:
The modeName value

getModeNames

public static String[] getModeNames()
Gets the names of all available case changing modes.

Returns:
a new string array with the names of the case changing modes in the current locale

getNumModes

public static int getNumModes()
Gets the number of available case changing modes

Returns:
The numModes value

changeCase

public static String[] changeCase(String[] input,
                                  int mode)
Changes the case of the specified strings. Equivalent to changeCase(input, null, mode) .

Parameters:
input - strings to process, my be null
mode - one of NO_CHANGE, LOWER, UPPER, UPPER_FIRST or UPPER_EACH_FIRST
Returns:
a new string array with the case-changed strings
See Also:
changeCase(String[], String[], int)

changeCase

public static String[] changeCase(String[] input,
                                  String[] output,
                                  int mode)
Changes the case of the specified strings.

Parameters:
input - strings to process, may be null
output - a string array to hold the case-changed strings that may be the same as input. If it is null or of incorrect length a new string array is allocated.
mode - one of NO_CHANGE, LOWER, UPPER, UPPER_FIRST or UPPER_EACH_FIRST
Returns:
the output array with the case-changed strings, non-null if input is non-null
See Also:
changeCase(String input, int mode)

changeCase

public static String changeCase(String input,
                                int mode)
Changes the case of the specified string

Parameters:
input - string to process, may be null
mode - one of NO_CHANGE, LOWER, UPPER, UPPER_FIRST or UPPER_EACH_FIRST
Returns:
case-changed string

Mp3dings 
20100427