Package net.sf.basedb.util.jep
Class PositionFunction
java.lang.Object
net.sf.basedb.util.jep.PositionFunction
- All Implemented Interfaces:
JepExpressionFunction
,JepFunction
,org.nfunk.jep.function.PostfixMathCommandI
A JEP function class that adds a
pos
function to a
JEP expression parser. The function will look up position.
For example:
pos()
To be able to use this function it must be registered with the JEP
parser. This function can only be used to convert a JEP expression to
a Query API Expression
. It doesn't support dynamic evalution.
- Version:
- 2.0
- Author:
- Enell
- See Also:
- Last modified
- $Date: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkNumberOfParameters
(int n) Get the name of this function.int
void
void
setCurNumberOfParameters
(int n) Can't be changed.toExpression
(Node node) Use theDynamic.column(VirtualColumn)
method to create an expression referencing a position.
-
Constructor Details
-
PositionFunction
public PositionFunction()
-
-
Method Details
-
getFunctionName
Description copied from interface:JepFunction
Get the name of this function. It is used when registering the function with aJEP
parser.- Specified by:
getFunctionName
in interfaceJepFunction
- Returns:
- The string "pos"
- See Also:
-
toExpression
Use theDynamic.column(VirtualColumn)
method to create an expression referencing a position.- Specified by:
toExpression
in interfaceJepExpressionFunction
- Parameters:
node
- The node representing this function- Returns:
- An
Expression
object
-
getNumberOfParameters
public int getNumberOfParameters()- Specified by:
getNumberOfParameters
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
- Returns:
- Always 0
-
setCurNumberOfParameters
public void setCurNumberOfParameters(int n) Can't be changed.- Specified by:
setCurNumberOfParameters
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
-
checkNumberOfParameters
public boolean checkNumberOfParameters(int n) - Specified by:
checkNumberOfParameters
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
-
run
- Specified by:
run
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
- Throws:
ParseException
-