activemq-cpp-3.9.0
decaf::lang::Character Class Reference

#include <src/main/decaf/lang/Character.h>

Inheritance diagram for decaf::lang::Character:

Public Member Functions

 Character (char value)
 
virtual int compareTo (const Character &c) const
 Compares this Character instance with another. More...
 
virtual bool operator== (const Character &c) const
 Compares equality between this object and the one passed. More...
 
virtual bool operator< (const Character &c) const
 Compares this object to another and returns true if this object is considered to be less than the one passed. More...
 
virtual int compareTo (const char &c) const
 Compares this Character instance with a char type. More...
 
virtual bool operator== (const char &c) const
 Compares equality between this object and the one passed. More...
 
virtual bool operator< (const char &c) const
 Compares this object to another and returns true if this object is considered to be less than the one passed. More...
 
bool equals (const Character &c) const
 
bool equals (const char &c) const
 
std::string toString () const
 
virtual double doubleValue () const
 Answers the double value which the receiver represents. More...
 
virtual float floatValue () const
 Answers the float value which the receiver represents. More...
 
virtual unsigned char byteValue () const
 Answers the byte value which the receiver represents. More...
 
virtual short shortValue () const
 Answers the short value which the receiver represents. More...
 
virtual int intValue () const
 Answers the int value which the receiver represents. More...
 
virtual long long longValue () const
 Answers the long value which the receiver represents. More...
 
- Public Member Functions inherited from decaf::lang::Number
virtual ~Number ()
 
- Public Member Functions inherited from decaf::lang::Comparable< Character >
virtual ~Comparable ()
 
- Public Member Functions inherited from decaf::lang::Comparable< char >
virtual ~Comparable ()
 

Static Public Member Functions

static Character valueOf (char value)
 Returns a Character instance representing the specified char value. More...
 
static bool isWhitespace (char c)
 Indicates whether or not the given character is considered whitespace. More...
 
static bool isDigit (char c)
 Indicates whether or not the given character is a digit. More...
 
static bool isLowerCase (char c)
 Indicates whether or not the given character is a lower case character. More...
 
static bool isUpperCase (char c)
 Indicates whether or not the given character is a upper case character. More...
 
static bool isLetter (char c)
 Indicates whether or not the given character is a letter. More...
 
static bool isLetterOrDigit (char c)
 Indicates whether or not the given character is either a letter or a digit. More...
 
static bool isISOControl (char c)
 Answers whether the character is an ISO control character, which is a char that lays in the range of 0 to 1f and 7f to 9f. More...
 
static int digit (char c, int radix)
 Returns the numeric value of the character ch in the specified radix. More...
 
static char toLowerCase (char value)
 Returns the lower case equivalent for the specified character if the character is an upper case letter. More...
 
static char toUpperCase (char value)
 Returns the upper case equivalent for the specified character if the character is a lower case letter. More...
 

Static Public Attributes

static const int MIN_RADIX
 The minimum radix available for conversion to and from strings. More...
 
static const int MAX_RADIX
 The maximum radix available for conversion to and from strings. More...
 
static const char MIN_VALUE
 The minimum value that a signed char can take on. More...
 
static const char MAX_VALUE
 The maximum value that a signed char can take on. More...
 
static const int SIZE
 The size of the primitive character in bits. More...
 

Constructor & Destructor Documentation

decaf::lang::Character::Character ( char  value)
Parameters
value- char to wrap.

Member Function Documentation

virtual unsigned char decaf::lang::Character::byteValue ( ) const
inlinevirtual

Answers the byte value which the receiver represents.

Returns
int the value of the receiver.

Reimplemented from decaf::lang::Number.

virtual int decaf::lang::Character::compareTo ( const Character c) const
inlinevirtual

Compares this Character instance with another.

Parameters
cthe Character instance to be compared
Returns
zero if this object represents the same char value as the argument; a positive value if this object represents a value greater than the passed in value, and -1 if this object represents a value less than the passed in value.

Implements decaf::lang::Comparable< Character >.

virtual int decaf::lang::Character::compareTo ( const char &  c) const
inlinevirtual

Compares this Character instance with a char type.

Parameters
cthe char instance to be compared
Returns
zero if this object represents the same char value as the argument; a positive value if this object represents a value greater than the passed in value, and -1 if this object represents a value less than the passed in value.

Implements decaf::lang::Comparable< char >.

static int decaf::lang::Character::digit ( char  c,
int  radix 
)
static

Returns the numeric value of the character ch in the specified radix.

If the radix is not in the range MIN_RADIX <= radix <= MAX_RADIX or if the value of ch is not a valid digit in the specified radix, -1 is returned. A character is a valid digit if at least one of the following is true:

  • The method isDigit is true of the character and the single-character decomposition is less than the specified radix. In this case the decimal digit value is returned.
  • The character is one of the uppercase Latin letters 'A' through 'Z' and its code is less than radix + 'A' - 10. In this case, ch - 'A' + 10 is returned.
  • The character is one of the lowercase Latin letters 'a' through 'z' and its code is less than radix + 'a' - 10. In this case, ch - 'a' + 10 is returned.
Parameters
cthe char to be converted
radixthe radix of the number
Returns
the numeric value of the number represented in the given radix
virtual double decaf::lang::Character::doubleValue ( ) const
inlinevirtual

Answers the double value which the receiver represents.

Returns
double the value of the receiver.

Implements decaf::lang::Number.

bool decaf::lang::Character::equals ( const Character c) const
inlinevirtual
Returns
true if the two Character Objects have the same value.

Implements decaf::lang::Comparable< Character >.

bool decaf::lang::Character::equals ( const char &  c) const
inlinevirtual
Returns
true if the two Characters have the same value.

Implements decaf::lang::Comparable< char >.

virtual float decaf::lang::Character::floatValue ( ) const
inlinevirtual

Answers the float value which the receiver represents.

Returns
float the value of the receiver.

Implements decaf::lang::Number.

virtual int decaf::lang::Character::intValue ( ) const
inlinevirtual

Answers the int value which the receiver represents.

Returns
int the value of the receiver.

Implements decaf::lang::Number.

static bool decaf::lang::Character::isDigit ( char  c)
inlinestatic

Indicates whether or not the given character is a digit.

Parameters
cThe character whose value is being checked.
Returns
true if the character is a digit value.
static bool decaf::lang::Character::isISOControl ( char  c)
inlinestatic

Answers whether the character is an ISO control character, which is a char that lays in the range of 0 to 1f and 7f to 9f.

Parameters
cthe character, including supplementary characters
Returns
true if the char is an ISO control character
static bool decaf::lang::Character::isLetter ( char  c)
inlinestatic

Indicates whether or not the given character is a letter.

Parameters
cThe character whose value is being checked.
Returns
true if the character is an ASCII letter value.
static bool decaf::lang::Character::isLetterOrDigit ( char  c)
inlinestatic

Indicates whether or not the given character is either a letter or a digit.

Parameters
cThe character whose value is being checked.
Returns
true if the character is an ASCII letter or numeric value.
static bool decaf::lang::Character::isLowerCase ( char  c)
inlinestatic

Indicates whether or not the given character is a lower case character.

Parameters
cThe character whose value is being checked.
Returns
true if the character is a lower case ASCII value.
static bool decaf::lang::Character::isUpperCase ( char  c)
inlinestatic

Indicates whether or not the given character is a upper case character.

Parameters
cThe character whose value is being checked.
Returns
true if the character is a upper case ASCII value.
static bool decaf::lang::Character::isWhitespace ( char  c)
inlinestatic

Indicates whether or not the given character is considered whitespace.

Parameters
cThe character whose value is being checked.
Returns
true if the character is a whitespace value.
virtual long long decaf::lang::Character::longValue ( ) const
inlinevirtual

Answers the long value which the receiver represents.

Returns
long the value of the receiver.

Implements decaf::lang::Number.

virtual bool decaf::lang::Character::operator< ( const Character c) const
inlinevirtual

Compares this object to another and returns true if this object is considered to be less than the one passed.

Parameters
cthe value to be compared to this one.
Returns
true if this object is equal to the one passed.

Implements decaf::lang::Comparable< Character >.

virtual bool decaf::lang::Character::operator< ( const char &  c) const
inlinevirtual

Compares this object to another and returns true if this object is considered to be less than the one passed.

This

Parameters
cthe value to be compared to this one.
Returns
true if this object is equal to the one passed.

Implements decaf::lang::Comparable< char >.

virtual bool decaf::lang::Character::operator== ( const Character c) const
inlinevirtual

Compares equality between this object and the one passed.

Parameters
cthe value to be compared to this one.
Returns
true if this object is equal to the one passed.

Implements decaf::lang::Comparable< Character >.

virtual bool decaf::lang::Character::operator== ( const char &  c) const
inlinevirtual

Compares equality between this object and the one passed.

Parameters
cthe value to be compared to this one.
Returns
true if this object is equal to the one passed.

Implements decaf::lang::Comparable< char >.

virtual short decaf::lang::Character::shortValue ( ) const
inlinevirtual

Answers the short value which the receiver represents.

Returns
int the value of the receiver.

Reimplemented from decaf::lang::Number.

static char decaf::lang::Character::toLowerCase ( char  value)
inlinestatic

Returns the lower case equivalent for the specified character if the character is an upper case letter.

Otherwise, the specified character is returned unchanged.

Parameters
valuethe character to convert if needed.
Returns
if value is an upper case character then its lower case counterpart, otherwise just returns value unchanged.
std::string decaf::lang::Character::toString ( ) const
Returns
this Character Object as a String Representation
static char decaf::lang::Character::toUpperCase ( char  value)
inlinestatic

Returns the upper case equivalent for the specified character if the character is a lower case letter.

Otherwise, the specified character is returned unchanged.

Parameters
valuethe character to convert to upper case if needed.
Returns
if value is a lower case character then its upper case counterpart, otherwise just returns value unchanged.
static Character decaf::lang::Character::valueOf ( char  value)
inlinestatic

Returns a Character instance representing the specified char value.

Parameters
valuethe primitive char to wrap.
Returns
a new Character instance that wraps this value.

Field Documentation

const int decaf::lang::Character::MAX_RADIX
static

The maximum radix available for conversion to and from strings.

const char decaf::lang::Character::MAX_VALUE
static

The maximum value that a signed char can take on.

const int decaf::lang::Character::MIN_RADIX
static

The minimum radix available for conversion to and from strings.

const char decaf::lang::Character::MIN_VALUE
static

The minimum value that a signed char can take on.

const int decaf::lang::Character::SIZE
static

The size of the primitive character in bits.


The documentation for this class was generated from the following file: