public class IntegerConstant extends Constant
Constructor and Description |
---|
IntegerConstant(byte[] v) |
IntegerConstant(int n)
Create a constant by wrapping the specified int.
|
Modifier and Type | Method and Description |
---|---|
Constant |
add(Constant c)
Adds this constant a value specified by another constant.
|
byte[] |
asBytes()
Returns the byte array corresponding to this constant value.
|
Object |
asJavaVal()
Unwraps the Integer and returns it.
|
Constant |
castTo(Type type)
Casts this constant to the specified type.
|
int |
compareTo(Constant c) |
Constant |
div(Constant c)
Divides this constant by a value specified by another constant.
|
boolean |
equals(Object obj)
Indicates whether some other object is
Constant object and its
value equal to this one. |
Type |
getType()
Returns the type corresponding to this constant.
|
int |
hashCode() |
Constant |
mul(Constant c)
Multiplies this constant by a value specified by another constant.
|
int |
size()
Return the number of bytes required to encode this constant.
|
Constant |
sub(Constant c)
Subtracts a value specified by another constant from this constant.
|
String |
toString() |
defaultInstance, newInstance
public IntegerConstant(int n)
n
- the int valuepublic IntegerConstant(byte[] v)
public Object asJavaVal()
asJavaVal
in class Constant
Constant.asJavaVal()
public Type getType()
Constant
public int size()
Constant
public byte[] asBytes()
Constant
public Constant castTo(Type type)
Constant
public boolean equals(Object obj)
Constant
object and its
value equal to this one.public int compareTo(Constant c)
public Constant add(Constant c)
Constant
public Constant sub(Constant c)
Constant
public Constant div(Constant c)
Constant
Copyright © 2022 VanillaDB Organization. All rights reserved.