public class ConstantExpression extends Object implements Expression
| Constructor and Description |
|---|
ConstantExpression(Constant c)
Creates a new expression by wrapping a constant.
|
| Modifier and Type | Method and Description |
|---|---|
Constant |
asConstant()
Unwraps the constant and returns it.
|
String |
asFieldName()
This method should never be called.
|
Constant |
evaluate(Record rec)
Returns the constant, regardless of the record.
|
boolean |
isApplicableTo(Schema sch)
Returns true, because a constant applies to any schema.
|
boolean |
isConstant()
Returns true.
|
boolean |
isFieldName()
Returns false.
|
String |
toString()
Return constant value as a string.
|
public ConstantExpression(Constant c)
c - the constantpublic boolean isConstant()
isConstant in interface ExpressionExpression.isConstant()public boolean isFieldName()
isFieldName in interface ExpressionExpression.isFieldName()public Constant asConstant()
asConstant in interface ExpressionExpression.asConstant()public String asFieldName()
asFieldName in interface ExpressionExpression.asFieldName()public Constant evaluate(Record rec)
evaluate in interface Expressionrec - the recordExpression.evaluate(Record)public boolean isApplicableTo(Schema sch)
isApplicableTo in interface Expressionsch - the schemaExpression.isApplicableTo(org.vanilladb.core.sql.Schema)Copyright © 2022 VanillaDB Organization. All rights reserved.