Package edu.caltech.nanodb.functions
Class Floor
- java.lang.Object
-
- edu.caltech.nanodb.functions.Function
-
- edu.caltech.nanodb.functions.ScalarFunction
-
- edu.caltech.nanodb.functions.SimpleFunction
-
- edu.caltech.nanodb.functions.Floor
-
- All Implemented Interfaces:
java.lang.Cloneable
public class Floor extends SimpleFunction
Computes the largest whole number smaller than the argument. Returns NULL if argument is NULL. The result is always a double-precision number, even though it is a whole number, since this is whatMath.floor(double)
returns.
-
-
Constructor Summary
Constructors Constructor Description Floor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
evaluate(Environment env, java.util.List<Expression> args)
Evaluates the function.ColumnType
getReturnType(java.util.List<Expression> args, Schema schema)
Returns the column type of the resulting column after applying the function.
-
-
-
Method Detail
-
getReturnType
public ColumnType getReturnType(java.util.List<Expression> args, Schema schema)
Description copied from class:ScalarFunction
Returns the column type of the resulting column after applying the function. This generally depends on the column type of the inputs.- Specified by:
getReturnType
in classScalarFunction
- Parameters:
args
- the arguments to the function callschema
- the schema of the table- Returns:
- the column type of the resulting column
-
evaluate
public java.lang.Object evaluate(Environment env, java.util.List<Expression> args)
Description copied from class:SimpleFunction
Evaluates the function. Should be called at runtime for every function call.- Specified by:
evaluate
in classSimpleFunction
- Parameters:
env
- Environment, in which the arguments are evaluatedargs
- Arguments for this function- Returns:
- The value of the function
-
-