org.ipdr.common
Class ArrayType

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

public class ArrayType
extends OpenType

This class represents the Array Type. This extends from OpenType. The derived type contains TypeCode + "ARRAY". It stores the max length of the array. If the max length is "unbounded", the max length is '-1'.


Field Summary
static java.lang.String ARRAY
          String containing "ARRAY" to use in derived type.
static java.lang.String DESCRIPTION
          String containing the base for default description.
protected  int maxLength_
          To store the Max Length of the Array.
protected  OpenType type_
          OpenType of the Array elements.
protected  char typeCode_
          Char containing the Type Code of the Array elements.
static int UNBOUNDED
          Int to represent the 'unbounded' max length.
 
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
ArrayType(OpenType type, int maxLen)
          Constructor that takes the Type of the Array elements its max length.
 
Method Summary
 int getMaxLength()
          Method to get the Max Length of the Array.
 OpenType getType()
          Method to get the Type of the Array elements.
 char getTypeCode()
          Method to get the Type Code of the Array elements.
static void main(java.lang.String[] args)
          Simple demonstration entry point.
 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

DESCRIPTION

public static final java.lang.String DESCRIPTION
String containing the base for default description.

See Also:
Constant Field Values

ARRAY

public static final java.lang.String ARRAY
String containing "ARRAY" to use in derived type.

See Also:
Constant Field Values

UNBOUNDED

public static final int UNBOUNDED
Int to represent the 'unbounded' max length.

See Also:
Constant Field Values

typeCode_

protected char typeCode_
Char containing the Type Code of the Array elements.


type_

protected OpenType type_
OpenType of the Array elements.


maxLength_

protected int maxLength_
To store the Max Length of the Array.

Constructor Detail

ArrayType

public ArrayType(OpenType type,
                 int maxLen)
Constructor that takes the Type of the Array elements its max length.

Parameters:
type - The OpenType of the elements
maxLen - The max length of the array
Method Detail

getType

public OpenType getType()
Method to get the Type of the Array elements.

Specified by:
getType in class OpenType
Returns:
The OpenType

getTypeCode

public char getTypeCode()
Method to get the Type Code of the Array elements.

Specified by:
getTypeCode in class OpenType
Returns:
The Type Code

getMaxLength

public int getMaxLength()
Method to get the Max Length of the Array.


toString

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

Overrides:
toString in class java.lang.Object
Returns:
ArrayType in string format

main

public static void main(java.lang.String[] args)
Simple demonstration entry point. Creates a ArrayType and then it invokes toString() method to display.