public final class DataGeneratorVariable
extends java.lang.Object
DataGeneratorVariable
class describes a variable passed to a data generator
in a query. Generated data must be assigned to unknown variables.Constructor and Description |
---|
DataGeneratorVariable(java.lang.String name,
ru.ispras.fortress.expression.Node node)
Constructs a variable with the specified name described with the specified
Node object. |
Modifier and Type | Method and Description |
---|---|
ru.ispras.fortress.data.types.bitvector.BitVector |
bitVectorValue()
Returns the variable value as a bit vector.
|
java.lang.String |
getName()
Returns the variable name.
|
int |
getSize()
Returns variable bit size.
|
ru.ispras.fortress.data.DataType |
getType()
Returns the variable data type.
|
ru.ispras.fortress.expression.NodeValue |
getValue()
Returns a node describing the variable value.
|
java.math.BigInteger |
integerValue()
Returns the variable value as an integer value.
|
boolean |
isUnknown()
Checks whether the variable is an unknown variable that must have its value assigned.
|
boolean |
isValueSet()
Checks whether the variable has been assigned a value.
|
void |
setValue(java.math.BigInteger value)
Assigns a
BigInteger value to the variable. |
void |
setValue(ru.ispras.fortress.data.types.bitvector.BitVector value)
Assigns a bit vector value to the variable.
|
void |
setValue(ru.ispras.fortress.data.Data value)
Assigns a value described by the specified data object to the variable.
|
void |
setValue(int value)
Assigns an integer value to the variable.
|
void |
setValue(long value)
Assigns a long integer value to the variable.
|
void |
setValue(ru.ispras.fortress.expression.NodeValue value)
Assigns a value described by the specified node to the variable.
|
public DataGeneratorVariable(java.lang.String name, ru.ispras.fortress.expression.Node node)
Node
object.name
- Variable name.node
- Node describing the variable.java.lang.IllegalArgumentException
- if any of the parameters is null
;
if the node is not a value or a variable; if the variable data type
is not a bit vector.public java.lang.String getName()
public ru.ispras.fortress.data.DataType getType()
public int getSize()
public boolean isUnknown()
true
if this is an unknown variable or false
otherwise.public boolean isValueSet()
true
if the variable has been assigned a value or false
otherwise.public ru.ispras.fortress.expression.NodeValue getValue()
java.lang.IllegalStateException
- if the variable has no value.public ru.ispras.fortress.data.types.bitvector.BitVector bitVectorValue()
BitVector
object.java.lang.IllegalStateException
- if the variable has no value or if it is not
represented by a bit vector.public java.math.BigInteger integerValue()
BigInteger
object.java.lang.IllegalStateException
- if the variable has no value or if it cannot be
converted to an integer value.public void setValue(int value)
value
- value to be assigned.java.lang.IllegalArgumentException
- if the argument is null
;
if the variable already has a value;
if the value type does not match the variable type.public void setValue(long value)
value
- value to be assigned.java.lang.IllegalArgumentException
- if the argument is null
;
if the variable already has a value;
if the value type does not match the variable type.public void setValue(java.math.BigInteger value)
BigInteger
value to the variable.value
- BigInteger
object describing the value to be assigned.java.lang.IllegalArgumentException
- if the argument is null
;
if the variable already has a value;
if the value type does not match the variable type.public void setValue(ru.ispras.fortress.data.types.bitvector.BitVector value)
value
- BitVector
object describing the value to be assigned.java.lang.IllegalArgumentException
- if the argument is null
;
if the variable already has a value;
if the value size does not match the variable size.public void setValue(ru.ispras.fortress.data.Data value)
value
- Data
object describing the value to be assigned.java.lang.IllegalArgumentException
- if the argument is null
;
if the variable already has a value;
if the value type does not match the variable type.public void setValue(ru.ispras.fortress.expression.NodeValue value)
value
- NodeValue
object describing the value to be assigned.java.lang.IllegalArgumentException
- if the argument is null
;
if the variable already has a value;
if the value type does not match the variable type.