public final class TypeConversion
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
TypeConversion.ConstCast
Constant operands casting types.
|
Modifier and Type | Method and Description |
---|---|
static Node |
castConstants(Node node)
Casts constant sub-...operands of the specified node supposing that casting is unsigned.
|
static Node |
castConstants(Node node,
java.lang.Enum<?> constCastKind)
Casts constant sub-...operands of the specified node through the specified casting type.
|
static Node |
coerce(Node node,
DataType type)
Converts the specified node to the specified data type producing a new node.
|
static Node |
coerce(Node node,
DataType type,
java.lang.Enum<?> constCastType)
Converts the specified node to the specified data type with some constant casting if needed.
|
static java.math.BigInteger |
integerValue(NodeValue value,
boolean signed) |
static boolean |
isIntegral(DataType type) |
static boolean |
isIntegral(Node node) |
static NodeValue |
valueOf(java.math.BigInteger value,
DataType type) |
public static Node castConstants(Node node, java.lang.Enum<?> constCastKind)
node
- Node to be processed.constCastKind
- Constant casting type descriptor (signed, unsigned, etc.).java.lang.IllegalArgumentException
- when node argument is null
.public static Node castConstants(Node node)
node
- Node to be processed.public static Node coerce(Node node, DataType type)
node
- Node to be converted.type
- Data type of the new node to be produced.public static Node coerce(Node node, DataType type, java.lang.Enum<?> constCastType)
If the specified node has the same data type as specified, no constant casting is applied.
node
- Node to be converted.type
- Data type of the new node to be produced.constCastType
- Constant operands casting mode.java.lang.IllegalArgumentException
- when either node or data type argument is null
.public static java.math.BigInteger integerValue(NodeValue value, boolean signed)
public static boolean isIntegral(Node node)
public static boolean isIntegral(DataType type)