Class CIMDataType
java.lang.Object
org.sblim.wbem.cim.CIMDataType
- All Implemented Interfaces:
Serializable, Cloneable
Provides the basic interface to define CIM data type defined by the CIM
specification.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Boolean.static final int
static final int
16 bit UCS-2 character.static final int
static final int
Class type.static final int
A string which defines a datetime value according the CIM specification.static final int
static final int
Invalid type.static final CIMDataType
static final int
static final int
static final int
static final int
static final int
Null type.static final CIMDataType
static final int
Numeric type for key propertiesstatic final int
CIMInstance type.static final int
IEEE 4-byte floating point.static final int
static final int
IEEE 8-byte floating point.static final int
static final int
Reference type.static final int
static final int
Signed 16-bit integer.static final int
static final int
Signed 32-bit integer.static final int
static final int
Signed 64-bit integer.static final int
static final int
Signed 8-bit integer.static final int
static final int
static final int
static final int
UCS String.static final int
static final int
Unsigned 16-bit integer.static final int
static final int
Unsigned 32-bit integer.static final int
static final int
Unsigned 64-bit integer.static final int
static final int
Unsigned 8-bit integer.static final int
-
Constructor Summary
ConstructorsConstructorDescriptionCIMDataType
(int pType) Constructs an object of cim data type using the specified data type value.CIMDataType
(int pType, int pSize) Constructs a cim data type with the specified type and size.CIMDataType
(String pRefClassName) Construct a CIMDataType which is a references of the specified CIMClass.CIMDataType
(String pRefClassName, int pSize) Construct a CIMDataType which is an array of references of the specified CIMClass. -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
static int
findArrayType
(int pSimpleType) Returns a value which represents the array type representation of a single type passed as an argument.static int
findSimpleType
(int pArrayType) Returns a value which represents the single type representation of an array type passed as an argument.static int
Returns an integer value that represents the data type for the specified object.static CIMDataType
getDataType
(String typeStr, boolean isArray) Returns the corresponding CIMDataType object for the specified string type.static CIMDataType
getPredefinedType
(int pType) Return a predefined value for the CIMDataType.Returns the class name pointed by this data type.int
getSize()
Returns the current size of the data type.Returns the string representation of this type.int
getType()
Returns the type of this object.int
hashCode()
boolean
Defermines if the current data type is an array type.boolean
Determines if the current data type is a reference type.static boolean
isTypeCompatible
(Object pValue, CIMDataType pDataType) Defermines if the specified data type is is compatible with the data type of the specified value.static void
void
setType
(int pType) Sets the current type of the object.toMOF()
Returns the MOF representation of this object.toString()
-
Field Details
-
INVALID
public static final int INVALIDInvalid type.- See Also:
-
UINT8
public static final int UINT8Unsigned 8-bit integer.- See Also:
-
SINT8
public static final int SINT8Signed 8-bit integer.- See Also:
-
UINT16
public static final int UINT16Unsigned 16-bit integer.- See Also:
-
SINT16
public static final int SINT16Signed 16-bit integer.- See Also:
-
UINT32
public static final int UINT32Unsigned 32-bit integer.- See Also:
-
SINT32
public static final int SINT32Signed 32-bit integer.- See Also:
-
UINT64
public static final int UINT64Unsigned 64-bit integer.- See Also:
-
SINT64
public static final int SINT64Signed 64-bit integer.- See Also:
-
STRING
public static final int STRINGUCS String.- See Also:
-
BOOLEAN
public static final int BOOLEANBoolean.- See Also:
-
REAL32
public static final int REAL32IEEE 4-byte floating point.- See Also:
-
REAL64
public static final int REAL64IEEE 8-byte floating point.- See Also:
-
DATETIME
public static final int DATETIMEA string which defines a datetime value according the CIM specification.- See Also:
-
CHAR16
public static final int CHAR1616 bit UCS-2 character.- See Also:
-
REFERENCE
public static final int REFERENCEReference type.- See Also:
-
NUMERIC
public static final int NUMERICNumeric type for key properties- See Also:
-
UINT8_ARRAY
public static final int UINT8_ARRAY- See Also:
-
SINT8_ARRAY
public static final int SINT8_ARRAY- See Also:
-
UINT16_ARRAY
public static final int UINT16_ARRAY- See Also:
-
SINT16_ARRAY
public static final int SINT16_ARRAY- See Also:
-
UINT32_ARRAY
public static final int UINT32_ARRAY- See Also:
-
SINT32_ARRAY
public static final int SINT32_ARRAY- See Also:
-
UINT64_ARRAY
public static final int UINT64_ARRAY- See Also:
-
SINT64_ARRAY
public static final int SINT64_ARRAY- See Also:
-
STRING_ARRAY
public static final int STRING_ARRAY- See Also:
-
BOOLEAN_ARRAY
public static final int BOOLEAN_ARRAY- See Also:
-
REAL32_ARRAY
public static final int REAL32_ARRAY- See Also:
-
REAL64_ARRAY
public static final int REAL64_ARRAY- See Also:
-
DATETIME_ARRAY
public static final int DATETIME_ARRAY- See Also:
-
CHAR16_ARRAY
public static final int CHAR16_ARRAY- See Also:
-
REFERENCE_ARRAY
public static final int REFERENCE_ARRAY- See Also:
-
OBJECT
public static final int OBJECTCIMInstance type.- See Also:
-
NULL
public static final int NULLNull type.- See Also:
-
CLASS
public static final int CLASSClass type.- See Also:
-
SIZE_SINGLE
public static final int SIZE_SINGLE- See Also:
-
SIZE_UNLIMITED
public static final int SIZE_UNLIMITED- See Also:
-
MIN_SINGLE_TYPE
public static final int MIN_SINGLE_TYPE- See Also:
-
MAX_SINGLE_TYPE
public static final int MAX_SINGLE_TYPE- See Also:
-
MIN_ARRAY_TYPE
public static final int MIN_ARRAY_TYPE- See Also:
-
MAX_ARRAY_TYPE
public static final int MAX_ARRAY_TYPE- See Also:
-
INVALID_DATATYPE
-
NULL_DATATYPE
-
-
Constructor Details
-
CIMDataType
public CIMDataType(int pType) Constructs an object of cim data type using the specified data type value. If the specified data type is an array type, assigns the size field to SIZE_UNLIMITED, otherwise assign it to SIZE_SINGLE.- Parameters:
pType
- One of the type constants in this class- Throws:
IllegalArgumentException
- if the specified data type is invalid
-
CIMDataType
public CIMDataType(int pType, int pSize) Constructs a cim data type with the specified type and size. A valid type value must be passed. This must be a value between MIN_SINGLE_TYPE and MAX_SINGLE_TYPE or between MIN_ARRAY_TYPE and MAX_ARRAY_TYPE. Additionally a valid size must be specified. A positive value or zero indicates that the array length is fixed. A value of SIZE_UNLIMITED means that the array is of variable size A value of SIZE_SINGLE is not meaningful.- Parameters:
pType
- One of the type constants in this classpSize
- The desirtd size SIZE_UNLIMITED, 0..MAX_INT_SIZE- Throws:
IllegalArgumentException
- if the data type is invalid or if the size is invalid.
-
CIMDataType
Construct a CIMDataType which is a references of the specified CIMClass.- Parameters:
pRefClassName
- The referenced class' name
-
CIMDataType
Construct a CIMDataType which is an array of references of the specified CIMClass.- Parameters:
pRefClassName
- The referenced class' namepSize
- The size of the array
-
-
Method Details
-
getRefClassName
Returns the class name pointed by this data type.- Returns:
- The referenced class' name
-
equals
-
hashCode
-
getType
public int getType()Returns the type of this object.- Returns:
- The type
-
setType
public void setType(int pType) Sets the current type of the object. Additionally, modifies the size field to SIZE_UNLIMITED if specified data type is an array type, otherwise assigns it to SIZE_SINGLE- Parameters:
pType
- The type- Throws:
IllegalArgumentException
- if the assigned data type is invalid
-
getSize
public int getSize()Returns the current size of the data type.- Returns:
- an integer which represents the size of the data type. A value of zero or a positive value means that the data type is an array type, and the value represent the size of the array. If the returned value is SIZE_UNLIMITED, the data type represents an unlimited size array, which means that the size has not been specified. If the returned value is SIZE_SINGLE, the data type represents a single element entity.
-
findType
Returns an integer value that represents the data type for the specified object. (i.e. NULL for null values, UINT8 for Unsigned8 values, and so on). If the value type is undetermined, return INVALID type.- Parameters:
pValue
- The value- Returns:
- The CIM data type fitting the value
-
getDataType
Returns the corresponding CIMDataType object for the specified string type. Given a string representation of the data type (i.e. "uint16") returns the appropriate CIMDataType. The isArray argument determine if the resulting data type must be an array type or a single type element.- Parameters:
typeStr
-isArray
-- Returns:
- CIMDataType
-
getPredefinedType
Return a predefined value for the CIMDataType. Applications are encourage to use this method instead of creating new CIMDataType objects. An exception to use this is when an array data type, with an specific size other than unlimited size, needs to be used.- Parameters:
pType
- One of the data type constants in this class- Returns:
- The data type
-
isArrayType
public boolean isArrayType()Defermines if the current data type is an array type.- Returns:
true
if this type is an array type,false
otherwise
-
isTypeCompatible
Defermines if the specified data type is is compatible with the data type of the specified value.- Parameters:
pValue
- The valuepDataType
- The data type- Returns:
true
, if compatible,false
otherwise
-
isReferenceType
public boolean isReferenceType()Determines if the current data type is a reference type.- Returns:
true
if this data type is a reference type,false
otherwise
-
clone
-
findArrayType
public static int findArrayType(int pSimpleType) Returns a value which represents the array type representation of a single type passed as an argument.- Parameters:
pSimpleType
- The simple type- Returns:
- returns the corresponding array element type, or INVALID if the specified data type does not has a corresponding array type element.
-
findSimpleType
public static int findSimpleType(int pArrayType) Returns a value which represents the single type representation of an array type passed as an argument.- Parameters:
pArrayType
- The array type- Returns:
- returns the corresponding single element type, or INVALID if the specified data type does not has a corresponding single type element.
-
getStringType
Returns the string representation of this type.- Returns:
- The string representation
-
toMOF
Returns the MOF representation of this object.- Returns:
- Teh MOF representation
-
toString
-
main
-