com.google.visualization.datasource.query.scalarfunction
Class Upper

java.lang.Object
  extended by com.google.visualization.datasource.query.scalarfunction.Upper
All Implemented Interfaces:
ScalarFunction

public class Upper
extends java.lang.Object
implements ScalarFunction

A unary scalar function that changes text to upper case.

Author:
Yaniv S.

Method Summary
 Value evaluate(java.util.List<Value> values)
          Executes the scalar function on the given list of values, and returns the Value which is the result of the execution the function.
 java.lang.String getFunctionName()
          Returns the function's name.
static Upper getInstance()
           
 ValueType getReturnType(java.util.List<ValueType> types)
          Returns the return type of the function, given specific types for its parameters.
 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 the number and types of the function parameters are valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Upper getInstance()
Returns:
The singleton instance of this class.

getFunctionName

public java.lang.String getFunctionName()
Returns the function's name.

Specified by:
getFunctionName in interface ScalarFunction
Returns:
The function's name.

evaluate

public Value evaluate(java.util.List<Value> values)
Description copied from interface: ScalarFunction
Executes the scalar function on the given list of values, and returns the Value which is the result of the execution the function.

Specified by:
evaluate in interface ScalarFunction
Parameters:
values - A list that contains one text value.
Returns:
An uppercase version of the input text value.

getReturnType

public ValueType getReturnType(java.util.List<ValueType> types)
Description copied from interface: ScalarFunction
Returns the return type of the function, given specific types for its parameters. Some functions can be polymorphic, i.e., their return type changes according to the types of their parameters.

Specified by:
getReturnType in interface ScalarFunction
Parameters:
types - A list of the types of the function's parameters.
Returns:
The return type of this function - TEXT.

validateParameters

public void validateParameters(java.util.List<ValueType> types)
                        throws InvalidQueryException
Validates that the number and types of the function parameters are valid. Throws an exception if they are not valid.

Specified by:
validateParameters in interface ScalarFunction
Parameters:
types - The given types of the function's parameters.
Throws:
InvalidQueryException - Thrown when the parameters are invalid.

toQueryString

public 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. Takes as arguments the query strings of the arguments.

Specified by:
toQueryString in interface ScalarFunction
Parameters:
argumentsQueryStrings - The query strings of the actual arguments.
Returns:
The query string.


Copyright © 2009 Google. All Rights Reserved.