public abstract class Constant extends Object implements Comparable<Constant>
type
.Constructor and Description |
---|
Constant() |
Modifier and Type | Method and Description |
---|---|
abstract Constant |
add(Constant c)
Adds this constant a value specified by another constant.
|
abstract byte[] |
asBytes()
Returns the byte array corresponding to this constant value.
|
abstract Object |
asJavaVal()
Returns the Java object corresponding to this constant.
|
abstract Constant |
castTo(Type type)
Casts this constant to the specified type.
|
static Constant |
defaultInstance(Type type)
Constructs a new instance of the specified type with default value.
|
abstract Constant |
div(Constant c)
Divides this constant by a value specified by another constant.
|
abstract Type |
getType()
Returns the type corresponding to this constant.
|
abstract Constant |
mul(Constant c)
Multiplies this constant by a value specified by another constant.
|
static Constant |
newInstance(Type type,
byte[] val)
Constructs a new instance of the specified type with value converted from
the input byte array.
|
abstract int |
size()
Return the number of bytes required to encode this constant.
|
abstract Constant |
sub(Constant c)
Subtracts a value specified by another constant from this constant.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compareTo
public static Constant newInstance(Type type, byte[] val)
type
- the specified typeval
- the byte array contains the valuepublic static Constant defaultInstance(Type type)
type
- the specified typepublic abstract Type getType()
public abstract Object asJavaVal()
public abstract byte[] asBytes()
public abstract int size()
public abstract Constant castTo(Type type)
type
- the type the caller intends to cast topublic abstract Constant add(Constant c)
c
- constant whose value will be addedpublic abstract Constant sub(Constant c)
c
- constant whose value will be substracted frompublic abstract Constant mul(Constant c)
c
- multiplierpublic abstract Constant div(Constant c)
c
- dividerCopyright © 2022 VanillaDB Organization. All rights reserved.