Package net.sf.basedb.util.jep
Class NotInReporterListFunction
- java.lang.Object
-
- net.sf.basedb.util.jep.NotInReporterListFunction
-
- All Implemented Interfaces:
JepFunction
,JepRestrictionFunction
,org.nfunk.jep.function.PostfixMathCommandI
public class NotInReporterListFunction extends Object implements JepRestrictionFunction
A JEP function class that adds anotInList(reporterListId)
function to a JEP expression parser. The function will check if a reporter doesn't exists in the reporter list with the ID given as an argument to this function.To be able to use this function it must be registered with the JEP parser and, before the expression is evaluated, a
SqlResult
object must be set.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
Jep
,BioAssaySetUtil.createJepRestriction(DbControl, String, DynamicQuery)
- Last modified
- $Date: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
-
-
Field Summary
Fields Modifier and Type Field Description private DbControl
dc
private int
numParameters
-
Constructor Summary
Constructors Constructor Description NotInReporterListFunction(DbControl dc)
Create a new instance of this function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkNumberOfParameters(int n)
String
getFunctionName()
Get the name of this function.int
getNumberOfParameters()
void
run(Stack stack)
void
setCurNumberOfParameters(int n)
Restriction
toRestriction(Node node)
Use theDynamic.isNotPartOf(ReporterList)
method to create a restriction checking that a reporter isn't found in the reporter list.
-
-
-
Field Detail
-
dc
private DbControl dc
-
numParameters
private int numParameters
-
-
Constructor Detail
-
NotInReporterListFunction
public NotInReporterListFunction(DbControl dc)
Create a new instance of this function. The new instance cannot be used to dynamically evaluate expressions. It should only be used for converting JEP formulas toRestriction
:s.- Parameters:
dc
- Open DbControl to use when accessing database and checking permissions.- See Also:
Jep.formulaToRestriction(String, JepFunction[])
-
-
Method Detail
-
getFunctionName
public String 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 "notInList"
- See Also:
JEP.addFunction(String, PostfixMathCommandI)
-
toRestriction
public Restriction toRestriction(Node node)
Use theDynamic.isNotPartOf(ReporterList)
method to create a restriction checking that a reporter isn't found in the reporter list.- Specified by:
toRestriction
in interfaceJepRestrictionFunction
- Parameters:
node
- The node representing this function- Returns:
- A
Restriction
object
-
getNumberOfParameters
public int getNumberOfParameters()
- Specified by:
getNumberOfParameters
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
- Returns:
- Always 1
-
setCurNumberOfParameters
public void setCurNumberOfParameters(int n)
- 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
public void run(Stack stack) throws ParseException
- Specified by:
run
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
- Throws:
ParseException
-
-