de.fuberlin.wiwiss.d2rq.expr
Class Constant
java.lang.Object
de.fuberlin.wiwiss.d2rq.expr.Expression
de.fuberlin.wiwiss.d2rq.expr.Constant
- Direct Known Subclasses:
- ConstantEx
public class Constant
- extends Expression
A constant-valued expression.
This class currently doesn't track
its type (Is the constant a number or string, for example?).
Since we need to know the type when writing the constant to SQL,
we keep a reference to an attribute around. The constant is assumed
to have the same type as that attribute. This is an ugly hack.
TODO Should have a DataType
instead of the silly column reference
- Author:
- Richard Cyganiak (richard@cyganiak.de)
Methods inherited from class de.fuberlin.wiwiss.d2rq.expr.Expression |
and, or |
Constant
public Constant(String value)
Constant
public Constant(String value,
Attribute attributeForTrackingType)
value
public String value()
attributes
public Set<Attribute> attributes()
- Specified by:
attributes
in class Expression
isFalse
public boolean isFalse()
- Specified by:
isFalse
in class Expression
isTrue
public boolean isTrue()
- Specified by:
isTrue
in class Expression
renameAttributes
public Expression renameAttributes(ColumnRenamer columnRenamer)
- Specified by:
renameAttributes
in class Expression
toSQL
public String toSQL(ConnectedDB database,
AliasMap aliases)
- Specified by:
toSQL
in class Expression
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object other)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object