public class IntegerVariable
extends java.lang.Object
IntegerVariable
represents a variable, which is a named entity with given width.Constructor and Description |
---|
IntegerVariable(int width,
java.math.BigInteger value)
Constructs a fake variable to store a constant value.
|
IntegerVariable(java.lang.String name,
int width)
Constructs a variable.
|
IntegerVariable(java.lang.String name,
int width,
java.math.BigInteger value)
Constructs a variable.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
IntegerField |
field(int lo,
int hi)
Creates an integer field for the current variable.
|
java.lang.String |
getName()
Returns the name of the variable.
|
java.math.BigInteger |
getValue()
Returns the value of the variable.
|
int |
getWidth()
Returns the width of the variable.
|
int |
hashCode() |
boolean |
isDefined()
Checks whether the variable is defined, i.e.
|
java.lang.String |
toString() |
public IntegerVariable(int width, java.math.BigInteger value)
width
- variable width in bits.value
- value to be stored.java.lang.IllegalArgumentException
- if width <= 0
or if value is null
.public IntegerVariable(java.lang.String name, int width, java.math.BigInteger value)
name
- the variable name.width
- the variable width.value
- the variable value or null.java.lang.IllegalArgumentException
- if width
is not positive.public IntegerVariable(java.lang.String name, int width)
name
- the variable name.width
- the variable width.java.lang.IllegalArgumentException
- if name == null
or width
is not positive.public final java.lang.String getName()
public final int getWidth()
public final boolean isDefined()
true
if the variable is defined; false
otherwise.public java.math.BigInteger getValue()
public final IntegerField field(int lo, int hi)
lo
- the lower bit index.hi
- the upper bit index.public final boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public final java.lang.String toString()
toString
in class java.lang.Object