Package com.mckoi.database
Class InternalFunctionFactory.DateObFunction
- java.lang.Object
-
- com.mckoi.database.AbstractFunction
-
- com.mckoi.database.InternalFunctionFactory.DateObFunction
-
- All Implemented Interfaces:
Function
- Enclosing class:
- InternalFunctionFactory
static class InternalFunctionFactory.DateObFunction extends AbstractFunction
-
-
Field Summary
Fields Modifier and Type Field Description private static java.text.DateFormatdate_format_fulprivate static java.text.DateFormatdate_format_lonprivate static java.text.DateFormatdate_format_medprivate static java.text.DateFormatdate_format_shoThe date format object that handles the conversion of Date objects to a string readable representation of the given date.private static java.text.DateFormatdate_format_sqlprivate static TTypeDATE_TYPE
-
Constructor Summary
Constructors Constructor Description DateObFunction(Expression[] params)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static TObjectdateVal(java.util.Date d)TObjectevaluate(GroupResolver group, VariableResolver resolver, QueryContext context)Evaluates the function and returns a TObject that represents the result of the function.TTypereturnTType(VariableResolver resolver, QueryContext context)By Default, we assume a function returns a Numeric object.-
Methods inherited from class com.mckoi.database.AbstractFunction
allElements, allVariables, getName, getParameter, init, isAggregate, isGlob, parameterCount, prepareParameters, returnTType, setAggregate, toString
-
-
-
-
Field Detail
-
DATE_TYPE
private static final TType DATE_TYPE
-
date_format_sho
private static final java.text.DateFormat date_format_sho
The date format object that handles the conversion of Date objects to a string readable representation of the given date.NOTE: Due to bad design these objects are not thread-safe.
-
date_format_sql
private static final java.text.DateFormat date_format_sql
-
date_format_med
private static final java.text.DateFormat date_format_med
-
date_format_lon
private static final java.text.DateFormat date_format_lon
-
date_format_ful
private static final java.text.DateFormat date_format_ful
-
-
Constructor Detail
-
DateObFunction
public DateObFunction(Expression[] params)
-
-
Method Detail
-
dateVal
private static TObject dateVal(java.util.Date d)
-
evaluate
public TObject evaluate(GroupResolver group, VariableResolver resolver, QueryContext context)
Description copied from interface:FunctionEvaluates the function and returns a TObject that represents the result of the function. The VariableResolver object should be used to look up variables in the parameter of the function. The 'FunctionTable' object should only be used when the function is a grouping function. For example, 'avg(value_of)'.
-
returnTType
public TType returnTType(VariableResolver resolver, QueryContext context)
Description copied from class:AbstractFunctionBy Default, we assume a function returns a Numeric object.- Specified by:
returnTTypein interfaceFunction- Overrides:
returnTTypein classAbstractFunction
-
-