Package com.mckoi.database
Class FunctionDef
java.lang.Object
com.mckoi.database.FunctionDef
- All Implemented Interfaces:
Serializable
,Cloneable
A definition of a function including its name and parameters. A FunctionDef
can easily be transformed into a Function object via a set of
FunctionFactory instances.
NOTE: This object is NOT immutable or thread-safe. A FunctionDef should not be shared among different threads.
- Author:
- Tobias Downer
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Performs a deep clone of this object.getFunction
(QueryContext context) Returns a Function object from this FunctionDef.getName()
The name of the function.The list of parameters that are passed to the function.boolean
isAggregate
(QueryContext context) Returns true if this function is an aggregate, or the parameters are aggregates.toString()
Human understandable string, used for the column title.
-
Constructor Details
-
FunctionDef
Constructs the FunctionDef.
-
-
Method Details
-
getName
The name of the function. For example, 'MIN' or 'CONCAT'. -
getParameters
The list of parameters that are passed to the function. For example, a concat function may have 7 parameters ('There', ' ', 'are', ' ', 10, ' ', 'bottles.') -
isAggregate
Returns true if this function is an aggregate, or the parameters are aggregates. It requires a QueryContext object to lookup the function in the function factory database. -
getFunction
Returns a Function object from this FunctionDef. Note that two calls to this method will produce the same Function object, however the same Function object will not be produced over multiple instances of FunctionDef even when they represent the same thing. -
clone
Performs a deep clone of this object.- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
toString
Human understandable string, used for the column title.
-