rebuild.util.ref
Class RefCharacter

java.lang.Object
  extended by rebuild.util.ref.RefCharacter

public final class RefCharacter
extends java.lang.Object

Reference Character is the same as Character but allows you to set the character without creating a new Character.

Since:
BBX 1.1.0

Field Summary
static int MAX_RADIX
          The maximum radix available for conversion to and from Strings.
static char MAX_VALUE
          The constant value of this field is the largest value of type char.
static int MIN_RADIX
          The minimum radix available for conversion to and from Strings.
static char MIN_VALUE
          The constant value of this field is the smallest value of type char.
 
Constructor Summary
RefCharacter()
          Create a new RefCharacter set to the default of '\0'.
RefCharacter(char value)
          Create a new RefCharacter using a char primitive.
RefCharacter(java.lang.Character value)
          Create a new RefCharacter using a Character.
RefCharacter(java.lang.Character value, boolean fixed)
          Create a new RefCharacter using a Character.
RefCharacter(char value, boolean fixed)
          Create a new RefCharacter using a char primitive.
 
Method Summary
 char charValue()
          Returns The value of this RefCharacter object as a char primitive.
 RefCharacter clone()
          Create a clone of the current object.
static int digit(char ch, int radix)
          Returns the numeric value of the character ch in the specified radix.
 boolean equals(java.lang.Object obj)
          Returns true if and only if the argument is not null and is a RefCharacter or Character object that represents the same char value as this object.
 int hashCode()
          Returns a hash code for this RefCharacter object.
static boolean isDigit(char ch)
          Determines if the specified character is a digit.
static boolean isLowerCase(char ch)
          Determines if the specified character is a lowercase character.
static boolean isUpperCase(char ch)
          Determines if the specified character is an uppercase character.
 RefCharacter setValue(char value)
          Set the value of this RefCharacter object with a char primitive.
 RefCharacter setValue(java.lang.Character value)
          Set the value of this RefCharacter object with a Character.
static char toLowerCase(char ch)
          The given character is mapped to its lowercase equivalent; if the character has no lowercase equivalent, the character itself is returned.
 java.lang.String toString()
          Returns a String object representing this RefCharacter's value.
static char toUpperCase(char ch)
          Converts the character argument to uppercase; if the character has no lowercase equivalent, the character itself is returned.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_RADIX

public static final int MAX_RADIX
The maximum radix available for conversion to and from Strings.

See Also:
Constant Field Values

MAX_VALUE

public static final char MAX_VALUE
The constant value of this field is the largest value of type char.

See Also:
Constant Field Values

MIN_RADIX

public static final int MIN_RADIX
The minimum radix available for conversion to and from Strings.

See Also:
Constant Field Values

MIN_VALUE

public static final char MIN_VALUE
The constant value of this field is the smallest value of type char.

See Also:
Constant Field Values
Constructor Detail

RefCharacter

public RefCharacter()
Create a new RefCharacter set to the default of '\0'.


RefCharacter

public RefCharacter(char value)
Create a new RefCharacter using a char primitive.

Parameters:
value - The char primitive to set this RefCharacter with.

RefCharacter

public RefCharacter(char value,
                    boolean fixed)
Create a new RefCharacter using a char primitive.

Parameters:
value - The char primitive to set this RefCharacter with.
fixed - If this item is read only and cannot be modified.

RefCharacter

public RefCharacter(java.lang.Character value)
Create a new RefCharacter using a Character.

Parameters:
value - The Character to set this RefCharacter with.

RefCharacter

public RefCharacter(java.lang.Character value,
                    boolean fixed)
Create a new RefCharacter using a Character.

Parameters:
value - The Character to set this RefCharacter with.
fixed - If this item is read only and cannot be modified.
Method Detail

charValue

public char charValue()
Returns The value of this RefCharacter object as a char primitive.

Returns:
The primitive char value of this object.

setValue

public RefCharacter setValue(char value)
Set the value of this RefCharacter object with a char primitive.

Parameters:
value - The primitive char value to set this object.
Returns:
This object.

setValue

public RefCharacter setValue(java.lang.Character value)
Set the value of this RefCharacter object with a Character.

Parameters:
value - The Character value to set this object.
Returns:
This object.

equals

public boolean equals(java.lang.Object obj)
Returns true if and only if the argument is not null and is a RefCharacter or Character object that represents the same char value as this object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to compare with.
Returns:
true if the RefCharacter objects represent the same value; false otherwise.

hashCode

public int hashCode()
Returns a hash code for this RefCharacter object.

Overrides:
hashCode in class java.lang.Object
Returns:
A hash code value for this object.

toString

public java.lang.String toString()
Returns a String object representing this RefCharacter's value.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of the object.

digit

public static int digit(char ch,
                        int radix)
Returns the numeric value of the character ch in the specified radix.

Parameters:
ch - The character to be converted.
radix - The radix.
Returns:
The numeric value represented by the character in the specified radix.

isDigit

public static boolean isDigit(char ch)
Determines if the specified character is a digit.

Parameters:
ch - The character to be tested.
Returns:
true if the character is a digit; false otherwise.

isLowerCase

public static boolean isLowerCase(char ch)
Determines if the specified character is a lowercase character.

Parameters:
ch - The character to be tested.
Returns:
True if the character is lowercase; false otherwise.

isUpperCase

public static boolean isUpperCase(char ch)
Determines if the specified character is an uppercase character.

Parameters:
ch - The character to be tested.
Returns:
true if the character is uppercase; false otherwise.

toLowerCase

public static char toLowerCase(char ch)
The given character is mapped to its lowercase equivalent; if the character has no lowercase equivalent, the character itself is returned.

Parameters:
ch - The character to be converted.
Returns:
The lowercase equivalent of the character, if any; otherwise the character itself.

toUpperCase

public static char toUpperCase(char ch)
Converts the character argument to uppercase; if the character has no lowercase equivalent, the character itself is returned.

Parameters:
ch - The character to be converted.
Returns:
The uppercase equivalent of the character, if any; otherwise the character itself.

clone

public RefCharacter clone()
Create a clone of the current object.

Returns:
A clone of the current RefCharacter.