Package com.arcadedb.function.sql
Class SQLFunctionLibraryDefinition
- java.lang.Object
-
- com.arcadedb.function.sql.SQLFunctionLibraryDefinition
-
- All Implemented Interfaces:
FunctionLibraryDefinition<SQLFunctionDefinition>
public class SQLFunctionLibraryDefinition extends Object implements FunctionLibraryDefinition<SQLFunctionDefinition>
-
-
Field Summary
Fields Modifier and Type Field Description protected Database
database
protected ConcurrentMap<String,SQLFunctionDefinition>
functions
protected String
libraryName
-
Constructor Summary
Constructors Constructor Description SQLFunctionLibraryDefinition(Database database, String libraryName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SQLFunctionDefinition
getFunction(String functionName)
Returns a function by its nameIterable<SQLFunctionDefinition>
getFunctions()
Returns an iterable of the defined functions.String
getName()
Returns the name of the library.boolean
hasFunction(String functionName)
Returns true if the function was defined, otherwise false.SQLFunctionLibraryDefinition
registerFunction(SQLFunctionDefinition function)
Registers a new function in the library.SQLFunctionLibraryDefinition
unregisterFunction(String functionName)
Unregister a function from the library by its name.
-
-
-
Field Detail
-
database
protected final Database database
-
libraryName
protected final String libraryName
-
functions
protected final ConcurrentMap<String,SQLFunctionDefinition> functions
-
-
Method Detail
-
registerFunction
public SQLFunctionLibraryDefinition registerFunction(SQLFunctionDefinition function)
Description copied from interface:FunctionLibraryDefinition
Registers a new function in the library.- Specified by:
registerFunction
in interfaceFunctionLibraryDefinition<SQLFunctionDefinition>
- Parameters:
function
- function object to register
-
unregisterFunction
public SQLFunctionLibraryDefinition unregisterFunction(String functionName)
Description copied from interface:FunctionLibraryDefinition
Unregister a function from the library by its name.- Specified by:
unregisterFunction
in interfaceFunctionLibraryDefinition<SQLFunctionDefinition>
- Parameters:
functionName
- Name of the function to unregister
-
getName
public String getName()
Description copied from interface:FunctionLibraryDefinition
Returns the name of the library.- Specified by:
getName
in interfaceFunctionLibraryDefinition<SQLFunctionDefinition>
-
getFunctions
public Iterable<SQLFunctionDefinition> getFunctions()
Description copied from interface:FunctionLibraryDefinition
Returns an iterable of the defined functions.- Specified by:
getFunctions
in interfaceFunctionLibraryDefinition<SQLFunctionDefinition>
-
hasFunction
public boolean hasFunction(String functionName)
Description copied from interface:FunctionLibraryDefinition
Returns true if the function was defined, otherwise false.- Specified by:
hasFunction
in interfaceFunctionLibraryDefinition<SQLFunctionDefinition>
- Parameters:
functionName
- Name of the function to look up to
-
getFunction
public SQLFunctionDefinition getFunction(String functionName)
Description copied from interface:FunctionLibraryDefinition
Returns a function by its name- Specified by:
getFunction
in interfaceFunctionLibraryDefinition<SQLFunctionDefinition>
- Parameters:
functionName
- Name of the function to retrieve
-
-