org.enhydra.zeus.util
Class CapitalizationUtils

java.lang.Object
  |
  +--org.enhydra.zeus.util.CapitalizationUtils

public class CapitalizationUtils
extends java.lang.Object

Capitalization is a Zeus utility class that provides for converting lowercase letters to uppercase ones, uppercase ones to lowercase ones, and more generally, converting Java Strings from an unknown format to initial caps (where only the first letter is capitalized), making a suitable class or variable name.

Author:
Brett McLaughlin

Constructor Summary
CapitalizationUtils()
           
 
Method Summary
static java.lang.String allLower(java.lang.String original)
           This will take a String with unknown capitalization, and convert all the letters to lowercase letters.
static java.lang.String allUpper(java.lang.String original)
           This will take a String with unknown capitalization, and convert all the letters to uppercase letters.
static java.lang.String initialLower(java.lang.String original)
           This will take a String with unknown capitalization, and convert the first letter to a lowercase letter, while leaving all other letters the same.
static java.lang.String initialUpper(java.lang.String original)
           This will take a String with unknown capitalization, and convert the first letter to a capital letter, while leaving all other letters the same.
static java.lang.String justInitialUpper(java.lang.String original)
           This will take a String with unknown capitalization, and convert the first letter to a capital letter, while converting all other letters to lowercase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapitalizationUtils

public CapitalizationUtils()
Method Detail

initialUpper

public static java.lang.String initialUpper(java.lang.String original)

This will take a String with unknown capitalization, and convert the first letter to a capital letter, while leaving all other letters the same. Note that if you want the rest of the letters converted to lowercase, then justInitialUpper(String) should be used.

Parameters:
original - String to convert.
Returns:
String - the converted String.

justInitialUpper

public static java.lang.String justInitialUpper(java.lang.String original)

This will take a String with unknown capitalization, and convert the first letter to a capital letter, while converting all other letters to lowercase. Note that if you want the rest of the letters left alone, then initialUpper(String) should be used.

Parameters:
original - String to convert.
Returns:
String - the converted String.

allUpper

public static java.lang.String allUpper(java.lang.String original)

This will take a String with unknown capitalization, and convert all the letters to uppercase letters. Note that if you want just the first letter converted to lowercase, then initialUpper(String) should be used.

And for all you geniuses out there, yes, I know that toUpperCase() can be used directly; but placing the code within this method allows this class to be uniformly used for all capitalization purposes.

Parameters:
original - String to convert.
Returns:
String - the converted String.

initialLower

public static java.lang.String initialLower(java.lang.String original)

This will take a String with unknown capitalization, and convert the first letter to a lowercase letter, while leaving all other letters the same. Note that if you want the rest of the letters converted to lowercase, then allLower(String) should be used.

Parameters:
original - String to convert.
Returns:
String - the converted String.

allLower

public static java.lang.String allLower(java.lang.String original)

This will take a String with unknown capitalization, and convert all the letters to lowercase letters. Note that if you want just the first letter converted to lowercase, then initialLower(String) should be used.

And for all you geniuses out there, yes, I know that toLowerCase() can be used directly; but placing the code within this method allows this class to be uniformly used for all capitalization purposes.

Parameters:
original - String to convert.
Returns:
String - the converted String.


Copyright © 2002 Enhydra. All Rights Reserved.