|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.visualization.datasource.query.scalarfunction.Constant
public class Constant
A constant function, i.e., a 0-ary function that always returns the same value, given at
construction time. The value can be of any supported ValueType.
| Constructor Summary | |
|---|---|
Constant(Value value)
Constructs a new constant function that always returns the given value. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
Value |
evaluate(java.util.List<Value> values)
Executes the scalar function constant(). |
java.lang.String |
getFunctionName()
Returns the function's name. |
ValueType |
getReturnType(java.util.List<ValueType> types)
Returns the return type of the function. |
int |
hashCode()
|
java.lang.String |
toQueryString(java.util.List<java.lang.String> argumentsQueryStrings)
Returns a string that when given to the query parser will yield a similar scalar function. |
void |
validateParameters(java.util.List<ValueType> types)
Validates that there are no parameters given for the function. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Constant(Value value)
value - The value to constantly return.| Method Detail |
|---|
public java.lang.String getFunctionName()
getFunctionName in interface ScalarFunctionpublic Value evaluate(java.util.List<Value> values)
values parameter is ignored.
Returns the value supplied at construction time.
evaluate in interface ScalarFunctionvalues - Ignored.
public ValueType getReturnType(java.util.List<ValueType> types)
types parameter is ignored.
getReturnType in interface ScalarFunctiontypes - Ignored.
public void validateParameters(java.util.List<ValueType> types)
throws InvalidQueryException
validateParameters in interface ScalarFunctiontypes - A list with parameters types. Should be empty for this type of function.
InvalidQueryException - Thrown if the parameters are invalid.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toQueryString(java.util.List<java.lang.String> argumentsQueryStrings)
toQueryString in interface ScalarFunctionargumentsQueryStrings - The query strings of the actual arguments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||