public final class DataType
extends java.lang.Object
DataType
class stores information about data types used by the solver engine.
It maintains a single instance for each data type (uniqueness is based on the data type
identifier and the data size).Modifier and Type | Field and Description |
---|---|
static DataType |
BOOLEAN
Predefined logic boolean data type.
|
static DataType |
INTEGER
Predefined logic integer data type.
|
static int |
LOGIC_TYPE_SIZE
The
LOGIC_TYPE_SIZE constant specifies the size of logic data types. |
static DataType |
REAL
Predefined logic real data type.
|
static DataType |
STRING
Predefined logic string data type.
|
static DataType |
UNKNOWN
Predefined unknown data type.
|
Modifier and Type | Method and Description |
---|---|
static DataType |
bitVector(int size)
Returns a data type describing a bit vector of the specified size.
|
boolean |
equals(java.lang.Object obj) |
java.lang.Object |
getAttribute(DataTypeId.Attribute attr) |
java.lang.Object[] |
getParameters() |
int |
getSize()
Returns the size of binary data in bits.
|
DataTypeId |
getTypeId()
Returns a data type identifier.
|
int |
getTypeRadix()
Returns a radix to be used for conversion data of this type to a string or vice versa.
|
java.lang.Class<?> |
getValueClass()
Returns the class that is used to store data (internal representation).
|
int |
hashCode() |
boolean |
isTypeId(DataTypeId typeId)
Checks whether the specified data type identifier is used.
|
static DataType |
map(DataType keyType,
DataType valueType)
Returns a data type describing a map that uses key and values of the specified data type.
|
static DataType |
newDataType(DataTypeId typeId,
int size)
Returns a data type for the specified data type identifier and data size.
|
static DataType |
newDataType(DataTypeId typeId,
java.lang.Object... parameters)
Returns an instance of a data type object based on its attributes.
|
java.lang.String |
toString() |
static DataType |
typeOf(java.lang.String text)
Creates an instance of a data type from the its textual representation.
|
Data |
valueOf(java.lang.String value,
int radix)
Creates an instance of a data object of a corresponding data type.
|
Data |
valueUninitialized()
Creates an uninitialized data object (the value is set to null).
|
public static final int LOGIC_TYPE_SIZE
LOGIC_TYPE_SIZE
constant specifies the size of logic data types.
Such types are not related with machine-dependent types and can have any size.
For this reason, we specify it as zero to distinguish from types that describe real data.public static final DataType INTEGER
public static final DataType REAL
public static final DataType STRING
public static final DataType BOOLEAN
public static final DataType UNKNOWN
public static DataType bitVector(int size)
size
- Bit vector size in bits.public static DataType map(DataType keyType, DataType valueType)
keyType
- Key type.valueType
- Value type.public static DataType newDataType(DataTypeId typeId, int size)
typeId
- Data type identifier.size
- Data size in bits.public static DataType newDataType(DataTypeId typeId, java.lang.Object... parameters)
typeId
- Type identifier.parameters
- List of type parameters.public DataTypeId getTypeId()
public boolean isTypeId(DataTypeId typeId)
true
is the specified data type identifier is used or false
otherwise.public int getSize()
LOGIC_TYPE_SIZE
for logic data types.public java.lang.Object[] getParameters()
public java.lang.Object getAttribute(DataTypeId.Attribute attr)
public int getTypeRadix()
public java.lang.Class<?> getValueClass()
public Data valueOf(java.lang.String value, int radix)
value
- The text representation of a value.radix
- The radix to be used for parsing.public static DataType typeOf(java.lang.String text)
text
- Textual representation of the data type.public Data valueUninitialized()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object