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 Expression
Expression.isConstant()
public boolean isFieldName()
isFieldName
in interface Expression
Expression.isFieldName()
public Constant asConstant()
asConstant
in interface Expression
Expression.asConstant()
public String asFieldName()
asFieldName
in interface Expression
Expression.asFieldName()
public Constant evaluate(Record rec)
evaluate
in interface Expression
rec
- the recordExpression.evaluate(Record)
public boolean isApplicableTo(Schema sch)
isApplicableTo
in interface Expression
sch
- the schemaExpression.isApplicableTo(org.vanilladb.core.sql.Schema)
Copyright © 2022 VanillaDB Organization. All rights reserved.