org.ipdr.common
Class SimpleType

java.lang.Object
  extended by org.ipdr.common.OpenType
      extended by org.ipdr.common.SimpleType

public class SimpleType
extends OpenType

This class represents all the basic types which form the building blocks to construct CompositeTypes and other structures which are descendants of OpenType.


Field Summary
static java.lang.String BOOLEAN
          String used for the base type definition for primitive Boolean objects.
protected static SimpleType booleanInstance_
           
static java.lang.String BYTE
          String used for the base type definition for primitive Byte objects.
protected static SimpleType byteInstance_
           
static java.lang.String DOUBLE
          String used for the base type definition for primitive Double objects.
protected static SimpleType doubleInstance_
           
static java.lang.String FLOAT
          String used for the base type definition for primitive Float objects.
protected static SimpleType floatInstance_
           
static java.lang.String HEX_BINARY
          String used for the base type definition for primitive Hexadecimal binaries.
protected static SimpleType hexBinaryInstance_
           
static java.lang.String INTEGER
          String used for the base type definition for primitive Integer objects.
protected static SimpleType integerInstance_
          internal containers for the static base SimpleType objects.
static java.lang.String LONG
          String used for the base type definition for primitive Long objects.
protected static SimpleType longInstance_
           
static java.lang.String SHORT
          String used for the base type definition for primitive Short objects.
protected static SimpleType shortInstance_
           
static java.lang.String STRING
          String used for the base type definition for primitive String objects.
protected static SimpleType stringInstance_
           
protected  OpenType type_
          Points to self or the underlying base type for a simple object.
protected  char typeCode_
          Each SimpleType has a unique code, object types all have the code "L".
static java.lang.String UNSIGNED_BYTE
          String used for the base type definition for primitive unsignedByte objects.
static java.lang.String UNSIGNED_INTEGER
          String used for the base type definition for primitive unsignedInt objects.
static java.lang.String UNSIGNED_LONG
          String used for the base type definition for primitive unsignedLong objects.
static java.lang.String UNSIGNED_SHORT
          String used for the base type definition for primitive unsignedShort objects.
protected static SimpleType unsignedByteInstance_
           
protected static SimpleType unsignedIntInstance_
           
protected static SimpleType unsignedLongInstance_
           
protected static SimpleType unsignedShortInstance_
           
 
Fields inherited from class org.ipdr.common.OpenType
BOOLEAN_TYPE_CODE, BYTE_TYPE_CODE, derivedType_, description_, DOUBLE_TYPE_CODE, FLOAT_TYPE_CODE, HEX_BINARY_TYPE_CODE, INTEGER_TYPE_CODE, LONG_TYPE_CODE, name_, OBJECT_TYPE_CODE, SHORT_TYPE_CODE, STRING_TYPE_CODE, UNSIGNEDBYTE_TYPE_CODE, UNSIGNEDINT_TYPE_CODE, UNSIGNEDLONG_TYPE_CODE, UNSIGNEDSHORT_TYPE_CODE
 
Constructor Summary
protected SimpleType(java.lang.String name, char typeCode)
          Protected constructor.
protected SimpleType(java.lang.String name, SimpleType type, java.lang.String description)
          Protected constructor.
 
Method Summary
static SimpleType createBooleanSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Boolean as its underlying type.
static SimpleType createByteSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Byte as its underlying type.
static SimpleType createDoubleSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Double as its underlying type.
static SimpleType createFloatSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Float as its underlying type.
static SimpleType createHexBinarySimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a HexBinary as its underlying type.
static SimpleType createIntegerSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Integer as its underlying type.
static SimpleType createLongSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Long as its underlying type.
static SimpleType createShortSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Short as its underlying type.
static SimpleType createStringSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a String as its underlying type.
static SimpleType createUnsignedByteSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a unsignedByte as its underlying type.
static SimpleType createUnsignedIntSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Integer for unsignedInt as its underlying type.
static SimpleType createUnsignedLongSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a Unsigned Long as its underlying type.
static SimpleType createUnsignedShortSimpleType(java.lang.String name, java.lang.String description)
          Method to get a SimpleType which has a unsignedShort as its underlying type.
static SimpleType getBooleanInstance()
          Accessor function to the immutable basic Boolean instance
static SimpleType getByteInstance()
          Accessor function to the immutable basic Byte instance
static SimpleType getDoubleInstance()
          Accessor function to the immutable basic Double instance
static SimpleType getFloatInstance()
          Accessor function to the immutable basic Float instance
static SimpleType getHexBinaryInstance()
          Accessor function to the immutable basic Hexadecimal binary instance
static SimpleType getIntegerInstance()
          Accessor function to the immutable basic Integer instance
static SimpleType getLongInstance()
          Accessor function to the immutable basic Long instance
static SimpleType getShortInstance()
          Accessor function to the immutable basic Short instance
static SimpleType getStringInstance()
          Accessor function to the immutable basic String instance
 OpenType getType()
          Retreives the details about this type.
 char getTypeCode()
          Retreives a simple type code for this simple type.
static SimpleType getUnsignedByteInstance()
          Accessor function to the immutable basic unsignedByte instance
static SimpleType getUnsignedIntInstance()
          Accessor function to the immutable basic unsignedInt instance
static SimpleType getUnsignedLongInstance()
          Accessor function to the immutable basic Unsigned Long instance
static SimpleType getUnsignedShortInstance()
          Accessor function to the immutable basic unsignedShort instance
 java.lang.String toString()
          Utility method for displaying types.
 
Methods inherited from class org.ipdr.common.OpenType
getDerivedType, getDescription, getName, setDerivedType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INTEGER

public static final java.lang.String INTEGER
String used for the base type definition for primitive Integer objects.

See Also:
Constant Field Values

UNSIGNED_INTEGER

public static final java.lang.String UNSIGNED_INTEGER
String used for the base type definition for primitive unsignedInt objects.

See Also:
Constant Field Values

LONG

public static final java.lang.String LONG
String used for the base type definition for primitive Long objects.

See Also:
Constant Field Values

UNSIGNED_LONG

public static final java.lang.String UNSIGNED_LONG
String used for the base type definition for primitive unsignedLong objects.

See Also:
Constant Field Values

FLOAT

public static final java.lang.String FLOAT
String used for the base type definition for primitive Float objects.

See Also:
Constant Field Values

DOUBLE

public static final java.lang.String DOUBLE
String used for the base type definition for primitive Double objects.

See Also:
Constant Field Values

HEX_BINARY

public static final java.lang.String HEX_BINARY
String used for the base type definition for primitive Hexadecimal binaries.

See Also:
Constant Field Values

STRING

public static final java.lang.String STRING
String used for the base type definition for primitive String objects. Note that these are not primitive types in Java, they are always objects.

See Also:
Constant Field Values

BOOLEAN

public static final java.lang.String BOOLEAN
String used for the base type definition for primitive Boolean objects.

See Also:
Constant Field Values

BYTE

public static final java.lang.String BYTE
String used for the base type definition for primitive Byte objects.

See Also:
Constant Field Values

UNSIGNED_BYTE

public static final java.lang.String UNSIGNED_BYTE
String used for the base type definition for primitive unsignedByte objects.

See Also:
Constant Field Values

SHORT

public static final java.lang.String SHORT
String used for the base type definition for primitive Short objects.

See Also:
Constant Field Values

UNSIGNED_SHORT

public static final java.lang.String UNSIGNED_SHORT
String used for the base type definition for primitive unsignedShort objects.

See Also:
Constant Field Values

integerInstance_

protected static SimpleType integerInstance_
internal containers for the static base SimpleType objects. Since these are immutable, no sense in making lots of them.


unsignedIntInstance_

protected static SimpleType unsignedIntInstance_

longInstance_

protected static SimpleType longInstance_

unsignedLongInstance_

protected static SimpleType unsignedLongInstance_

floatInstance_

protected static SimpleType floatInstance_

doubleInstance_

protected static SimpleType doubleInstance_

hexBinaryInstance_

protected static SimpleType hexBinaryInstance_

stringInstance_

protected static SimpleType stringInstance_

booleanInstance_

protected static SimpleType booleanInstance_

byteInstance_

protected static SimpleType byteInstance_

unsignedByteInstance_

protected static SimpleType unsignedByteInstance_

shortInstance_

protected static SimpleType shortInstance_

unsignedShortInstance_

protected static SimpleType unsignedShortInstance_

type_

protected OpenType type_
Points to self or the underlying base type for a simple object.


typeCode_

protected char typeCode_
Each SimpleType has a unique code, object types all have the code "L". This convention is based on model introduced in the javadoc for java.lang.Class (see description of getName()). This code allows for fast casting of a primitive Object in switch statements based on type code.

Constructor Detail

SimpleType

protected SimpleType(java.lang.String name,
                     char typeCode)
Protected constructor. Used to creation single instance of a simple type.


SimpleType

protected SimpleType(java.lang.String name,
                     SimpleType type,
                     java.lang.String description)
Protected constructor. Used to creation single instance of a simple type.

Method Detail

getIntegerInstance

public static SimpleType getIntegerInstance()
Accessor function to the immutable basic Integer instance

Returns:
The integerInstance value

getUnsignedIntInstance

public static SimpleType getUnsignedIntInstance()
Accessor function to the immutable basic unsignedInt instance

Returns:
The unsignedIntInstance value

getLongInstance

public static SimpleType getLongInstance()
Accessor function to the immutable basic Long instance

Returns:
The longInstance value

getUnsignedLongInstance

public static SimpleType getUnsignedLongInstance()
Accessor function to the immutable basic Unsigned Long instance

Returns:
The unsignedLongInstance value

getFloatInstance

public static SimpleType getFloatInstance()
Accessor function to the immutable basic Float instance

Returns:
The floatInstance value

getDoubleInstance

public static SimpleType getDoubleInstance()
Accessor function to the immutable basic Double instance

Returns:
The doubleInstance value

getHexBinaryInstance

public static SimpleType getHexBinaryInstance()
Accessor function to the immutable basic Hexadecimal binary instance

Returns:
The hexBinaryInstance value

getStringInstance

public static SimpleType getStringInstance()
Accessor function to the immutable basic String instance

Returns:
The stringInstance value

getBooleanInstance

public static SimpleType getBooleanInstance()
Accessor function to the immutable basic Boolean instance

Returns:
The booleanInstance value

getByteInstance

public static SimpleType getByteInstance()
Accessor function to the immutable basic Byte instance

Returns:
The byteInstance value

getUnsignedByteInstance

public static SimpleType getUnsignedByteInstance()
Accessor function to the immutable basic unsignedByte instance

Returns:
The unsignedByteInstance value

getShortInstance

public static SimpleType getShortInstance()
Accessor function to the immutable basic Short instance

Returns:
The shortInstance value

getUnsignedShortInstance

public static SimpleType getUnsignedShortInstance()
Accessor function to the immutable basic unsignedShort instance

Returns:
The unsignedShortInstance value

createIntegerSimpleType

public static SimpleType createIntegerSimpleType(java.lang.String name,
                                                 java.lang.String description)
Method to get a SimpleType which has a Integer as its underlying type.


createUnsignedIntSimpleType

public static SimpleType createUnsignedIntSimpleType(java.lang.String name,
                                                     java.lang.String description)
Method to get a SimpleType which has a Integer for unsignedInt as its underlying type.


createLongSimpleType

public static SimpleType createLongSimpleType(java.lang.String name,
                                              java.lang.String description)
Method to get a SimpleType which has a Long as its underlying type.


createUnsignedLongSimpleType

public static SimpleType createUnsignedLongSimpleType(java.lang.String name,
                                                      java.lang.String description)
Method to get a SimpleType which has a Unsigned Long as its underlying type.


createFloatSimpleType

public static SimpleType createFloatSimpleType(java.lang.String name,
                                               java.lang.String description)
Method to get a SimpleType which has a Float as its underlying type.


createDoubleSimpleType

public static SimpleType createDoubleSimpleType(java.lang.String name,
                                                java.lang.String description)
Method to get a SimpleType which has a Double as its underlying type.


createHexBinarySimpleType

public static SimpleType createHexBinarySimpleType(java.lang.String name,
                                                   java.lang.String description)
Method to get a SimpleType which has a HexBinary as its underlying type.


createStringSimpleType

public static SimpleType createStringSimpleType(java.lang.String name,
                                                java.lang.String description)
Method to get a SimpleType which has a String as its underlying type.


createBooleanSimpleType

public static SimpleType createBooleanSimpleType(java.lang.String name,
                                                 java.lang.String description)
Method to get a SimpleType which has a Boolean as its underlying type.


createByteSimpleType

public static SimpleType createByteSimpleType(java.lang.String name,
                                              java.lang.String description)
Method to get a SimpleType which has a Byte as its underlying type.


createUnsignedByteSimpleType

public static SimpleType createUnsignedByteSimpleType(java.lang.String name,
                                                      java.lang.String description)
Method to get a SimpleType which has a unsignedByte as its underlying type.


createShortSimpleType

public static SimpleType createShortSimpleType(java.lang.String name,
                                               java.lang.String description)
Method to get a SimpleType which has a Short as its underlying type.


createUnsignedShortSimpleType

public static SimpleType createUnsignedShortSimpleType(java.lang.String name,
                                                       java.lang.String description)
Method to get a SimpleType which has a unsignedShort as its underlying type.


getType

public OpenType getType()
Retreives the details about this type. Note that for 'SimpleType' base objects (such as Integer, Byte, etc), this function simply returns a copy of itself.

Specified by:
getType in class OpenType
Returns:
The OpenType value

getTypeCode

public char getTypeCode()
Retreives a simple type code for this simple type. This can be used in switch statements since it is a char value and not a string.

Specified by:
getTypeCode in class OpenType
Returns:
The TypeCode value

toString

public java.lang.String toString()
Utility method for displaying types. Use XML style output.

Overrides:
toString in class java.lang.Object
Returns:
String representation of the SimleType