com.sun.wbem.cim
Class CIMDataType

java.lang.Object
  |
  +--com.sun.wbem.cim.CIMDataType

public class CIMDataType
extends java.lang.Object
implements java.io.Serializable

Encapsulates the CIM data types (as defined in the CIM Specification). This class includes methods that perform operations on CIM data types, such as, returning the CIM data type of a CIM object, returning an array of CIM data types for an array of CIM objects, and creating an object or array of objects of the specified CIM data type. All CIM properties must have a valid CIM data type.

Since:
WBEM 1.0
See Also:
Serialized Form

Field Summary
static int BOOLEAN
          Boolean
static int BOOLEAN_ARRAY
          Boolean array
static int CHAR16
          16-bit UCS-2 character
static int CHAR16_ARRAY
          16-bit UCS-2 character
static int CLASS
          CIMClass type
static int DATETIME
          A string containing the date-time
static int DATETIME_ARRAY
          A string containing the date-time
static int INVALID
          Invalid type
static int NULL
          Null type
static int OBJECT
          CIMInstance type
static int REAL32
          IEEE 4-byte floating-point
static int REAL32_ARRAY
          IEEE 4-byte floating-point
static int REAL64
          IEEE 8-byte floating-point
static int REAL64_ARRAY
          IEEE 8-byte floating-point
static int REFERENCE
          Reference type
static int SINT16
          Signed 16-bit integer
static int SINT16_ARRAY
          Signed 16-bit integer array
static int SINT32
          Signed 32-bit integer
static int SINT32_ARRAY
          Signed 32-bit integer array
static int SINT64
          Signed 64-bit integer
static int SINT64_ARRAY
          Signed 64-bit integer array
static int SINT8
          Signed 8-bit integer
static int SINT8_ARRAY
          Signed 8-bit integer array
static int SIZE_SINGLE
          This size is for non-array types
static int SIZE_UNLIMITED
          This size is for unlimited size array types.
static int STRING
          UCS-2 string
static int STRING_ARRAY
          UCS-2 string array
static int UINT16
          Unsigned 16-bit integer
static int UINT16_ARRAY
          Unsigned 16-bit integer array
static int UINT32
          Unsigned 32-bit integer
static int UINT32_ARRAY
          Unsigned 32-bit integer array
static int UINT64
          Unsigned 64-bit integer
static int UINT64_ARRAY
          Unsigned 64-bit integer array
static int UINT8
          Unsigned 8-bit integer
static int UINT8_ARRAY
          Unsigned 8-bit integer array
 
Constructor Summary
CIMDataType(int type)
          Constructor creates a new CIM data type object with the specified type (does not take reference, null types).
CIMDataType(int type, int size)
          Constructor creates a new CIM array data type with the specified size.
CIMDataType(java.lang.String refClassName)
          Creates a new CIM REFERENCE data type object with the specified class reference.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Checks that the specified object is a CIM data type
static int findArrayType(int simpleType)
          Takes a CIM data type and returns the CIM array type.
static int findSimpleType(int arrayType)
          Takes a CIM array type and returns the CIM data type.
static int findType(java.lang.Object o)
          Returns the CIM data type for the specified object
static int findType(java.util.Vector v)
          Returns the CIM data type for the specified list of objects.
static CIMDataType getDataType(java.lang.String type)
           
static CIMDataType getDataType(java.lang.String type, boolean isArray)
           
static CIMDataType getPredefinedType(int type)
          Returns a CIM data type object with the specified predefined type.
 java.lang.String getRefClassName()
          Returns the classname for the reference type.
 int getSize()
          Returns the size
 int getType()
          Returns the data type
 boolean isArrayType()
          Checks if the type is an array type.
 boolean isReferenceType()
          Checks if the type is a reference type.
 java.lang.String toMOF()
          Returns a MOF representation of the CIMDataType
 java.lang.String toString()
          Returns a String representation of the CIMDataType.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIZE_SINGLE

public static final int SIZE_SINGLE
This size is for non-array types

SIZE_UNLIMITED

public static final int SIZE_UNLIMITED
This size is for unlimited size array types. This is the default value for array types.

INVALID

public static final int INVALID
Invalid type

UINT8

public static final int UINT8
Unsigned 8-bit integer
See Also:
UnsignedInt8

SINT8

public static final int SINT8
Signed 8-bit integer

UINT16

public static final int UINT16
Unsigned 16-bit integer
See Also:
UnsignedInt16

SINT16

public static final int SINT16
Signed 16-bit integer

UINT32

public static final int UINT32
Unsigned 32-bit integer
See Also:
UnsignedInt32

SINT32

public static final int SINT32
Signed 32-bit integer

UINT64

public static final int UINT64
Unsigned 64-bit integer
See Also:
UnsignedInt64

SINT64

public static final int SINT64
Signed 64-bit integer

STRING

public static final int STRING
UCS-2 string

BOOLEAN

public static final int BOOLEAN
Boolean

REAL32

public static final int REAL32
IEEE 4-byte floating-point

REAL64

public static final int REAL64
IEEE 8-byte floating-point

DATETIME

public static final int DATETIME
A string containing the date-time
See Also:
CIMDateTime

CHAR16

public static final int CHAR16
16-bit UCS-2 character

UINT8_ARRAY

public static final int UINT8_ARRAY
Unsigned 8-bit integer array
See Also:
UnsignedInt8

SINT8_ARRAY

public static final int SINT8_ARRAY
Signed 8-bit integer array

UINT16_ARRAY

public static final int UINT16_ARRAY
Unsigned 16-bit integer array
See Also:
UnsignedInt16

SINT16_ARRAY

public static final int SINT16_ARRAY
Signed 16-bit integer array

UINT32_ARRAY

public static final int UINT32_ARRAY
Unsigned 32-bit integer array
See Also:
UnsignedInt32

SINT32_ARRAY

public static final int SINT32_ARRAY
Signed 32-bit integer array

UINT64_ARRAY

public static final int UINT64_ARRAY
Unsigned 64-bit integer array
See Also:
UnsignedInt64

SINT64_ARRAY

public static final int SINT64_ARRAY
Signed 64-bit integer array

STRING_ARRAY

public static final int STRING_ARRAY
UCS-2 string array

BOOLEAN_ARRAY

public static final int BOOLEAN_ARRAY
Boolean array

REAL32_ARRAY

public static final int REAL32_ARRAY
IEEE 4-byte floating-point

REAL64_ARRAY

public static final int REAL64_ARRAY
IEEE 8-byte floating-point

DATETIME_ARRAY

public static final int DATETIME_ARRAY
A string containing the date-time
See Also:
CIMDateTime

CHAR16_ARRAY

public static final int CHAR16_ARRAY
16-bit UCS-2 character

REFERENCE

public static final int REFERENCE
Reference type

OBJECT

public static final int OBJECT
CIMInstance type

NULL

public static final int NULL
Null type

CLASS

public static final int CLASS
CIMClass type
Constructor Detail

CIMDataType

public CIMDataType(int type)
Constructor creates a new CIM data type object with the specified type (does not take reference, null types). For array types, the size is initialized to SIZE_UNLIMITED by default, and for single valued types, the size is initialized to SIZE_SINGLE.
Parameters:
type - the CIM data type

CIMDataType

public CIMDataType(int type,
                   int size)
Constructor creates a new CIM array data type with the specified size.
Parameters:
type - the CIM array data type
size - the CIM array size

CIMDataType

public CIMDataType(java.lang.String refClassName)
Creates a new CIM REFERENCE data type object with the specified class reference.
Parameters:
type - the CIM class reference.
Method Detail

findType

public static final int findType(java.lang.Object o)
Returns the CIM data type for the specified object
Parameters:
o - the object for which the data type is to be checked
Returns:
int the integer representing the CIM data type of the specified object

getDataType

public static CIMDataType getDataType(java.lang.String type)
                               throws CIMException

getDataType

public static CIMDataType getDataType(java.lang.String type,
                                      boolean isArray)
                               throws CIMException

findType

public static final int findType(java.util.Vector v)
Returns the CIM data type for the specified list of objects.
Parameters:
v - the list of objects for which the data type is to be checked
Returns:
int the integer for the CIM array data type of the specified list of objects. Returns INVALID if the list is empty. Returns NULL if an object is null.

findArrayType

public static final int findArrayType(int simpleType)
Takes a CIM data type and returns the CIM array type. Returns INVALID if there is no reference array type.
Parameters:
simpleType - the integer for the CIM data type of this object
Returns:
int the integer for CIM array type. Otherwise, INVALID if there is no reference array type.

findSimpleType

public static final int findSimpleType(int arrayType)
Takes a CIM array type and returns the CIM data type. Returns INVALID if there is no reference data type.
Parameters:
arrayType - the integer for the CIM array type of this object
Returns:
int the integer for the CIM data type of this object. Otherwise, INVALID if there is no CIM data type.

getPredefinedType

public static CIMDataType getPredefinedType(int type)
Returns a CIM data type object with the specified predefined type.
Parameters:
type - the CIM data type

isArrayType

public boolean isArrayType()
Checks if the type is an array type.
Returns:
true if the type is an array type, false otherwise.

isReferenceType

public boolean isReferenceType()
Checks if the type is a reference type.
Returns:
true if the type is a reference type, false otherwise.

getType

public int getType()
Returns the data type

getSize

public int getSize()
Returns the size

getRefClassName

public java.lang.String getRefClassName()
Returns the classname for the reference type.

equals

public boolean equals(java.lang.Object obj)
Checks that the specified object is a CIM data type
Overrides:
equals in class java.lang.Object
Returns:
boolean true if the specified object is a CIM data type. Otherwise, false.

toString

public java.lang.String toString()
Returns a String representation of the CIMDataType. This method is intended to be used only for debugging purposes, and the format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Overrides:
toString in class java.lang.Object
Returns:
string representation of this data type

toMOF

public java.lang.String toMOF()
Returns a MOF representation of the CIMDataType
Returns:
a string representation of this data type in Managed Object Format (MOF)