|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.visualization.datasource.query.scalarfunction.TimeComponentExtractor
public class TimeComponentExtractor
A time component extractor. This class encompasses all the unary scalar functions that extract a time component from a date/datetime/timeofday value. e.g., year, month, second.
| Nested Class Summary | |
|---|---|
static class |
TimeComponentExtractor.TimeComponent
An enum of time components that can be extracted from a date/datetime/timeofday value. |
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
Value |
evaluate(java.util.List<Value> values)
Executes the scalar function that extracts the timeComponent on the given values. |
java.lang.String |
getFunctionName()
Returns the name of this scalar function, in this case the name of the TimeComponentExtractor. |
static TimeComponentExtractor |
getInstance(TimeComponentExtractor.TimeComponent timeComponent)
Returns an instance of a TimeComponentExtractor that extracts the given TimeComponent. |
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 is only one parameter given for the function, and that its type is DATE or DATETIME if the timeComponent to extract is year, month or day, or that it is DATETIME or TIMEOFDAY if the timeComponent is hour, minute, second or millisecond. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static TimeComponentExtractor getInstance(TimeComponentExtractor.TimeComponent timeComponent)
timeComponent - The TimeComponent to extract.
public java.lang.String getFunctionName()
getFunctionName in interface ScalarFunctionpublic Value evaluate(java.util.List<Value> values)
evaluate in interface ScalarFunctionvalues - A list of the values on which the scalar function is performed.
public ValueType getReturnType(java.util.List<ValueType> types)
getReturnType in interface ScalarFunctiontypes - A list of the types of the scalar function parameters.
public void validateParameters(java.util.List<ValueType> types)
throws InvalidQueryException
validateParameters in interface ScalarFunctiontypes - A list of parameter types.
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 | |||||||||