Package com.arcadedb.query.sql.function
Class SQLFunctionAbstract
- java.lang.Object
-
- com.arcadedb.query.sql.function.SQLFunctionAbstract
-
- All Implemented Interfaces:
SQLFunction
- Direct Known Subclasses:
SQLFunctionCoalesce
,SQLFunctionConfigurableAbstract
,SQLFunctionDate
,SQLFunctionDecode
,SQLFunctionDistance
,SQLFunctionEncode
,SQLFunctionFormat
,SQLFunctionIf
,SQLFunctionIfNull
,SQLFunctionMode
,SQLFunctionPercentile
,SQLFunctionStrcmpci
,SQLFunctionSysdate
,SQLFunctionUUID
,SQLFunctionVariance
,SQLStaticReflectiveFunction
public abstract class SQLFunctionAbstract extends Object implements SQLFunction
Abstract class to extend to build Custom SQL Functions.- Author:
- Luca Garulli (l.garulli--(at)--gmail.com)
-
-
Constructor Summary
Constructors Constructor Description SQLFunctionAbstract(String iName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
aggregateResults()
A function can make calculation on several records before returning a result.void
config(Object[] iConfiguredParameters)
Configure the function.String
getName()
Function name, the name is used by the sql parser to identify a call this function.Object
getResult()
Only called when function aggregates results after all records have been passed to the function.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.arcadedb.query.sql.executor.SQLFunction
execute, getSyntax
-
-
-
-
Field Detail
-
name
protected String name
-
-
Constructor Detail
-
SQLFunctionAbstract
public SQLFunctionAbstract(String iName)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:SQLFunction
Function name, the name is used by the sql parser to identify a call this function.- Specified by:
getName
in interfaceSQLFunction
- Returns:
- String , function name, never null or empty.
-
config
public void config(Object[] iConfiguredParameters)
Description copied from interface:SQLFunction
Configure the function.- Specified by:
config
in interfaceSQLFunction
-
aggregateResults
public boolean aggregateResults()
Description copied from interface:SQLFunction
A function can make calculation on several records before returning a result.Example of such function : sum, count, max, min ...
The final result of the aggregation is obtained by calling
SQLFunction.getResult()
- Specified by:
aggregateResults
in interfaceSQLFunction
- Returns:
- true if function aggregate results
-
getResult
public Object getResult()
Description copied from interface:SQLFunction
Only called when function aggregates results after all records have been passed to the function.- Specified by:
getResult
in interfaceSQLFunction
- Returns:
- Aggregation result
-
-