|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.jep.ExtraValueFunction
public class ExtraValueFunction
A JEP function class that adds a xtra(int)
function to a
JEP expression parser. The function will look up the value of the extra value
with the given ID. For example: xtra(1)
To be able to use this function it must be registered with the JEP parser.
Jep
,
BioAssaySetUtil.createJepExpression(DbControl, String, DynamicQuery)
Field Summary | |
---|---|
private BioAssaySet |
bas
|
private DbControl |
dc
|
private Map<Integer,Integer> |
extraToIndex
|
private int |
numParameters
|
private SqlResult |
result
|
Constructor Summary | |
---|---|
ExtraValueFunction(DbControl dc,
BioAssaySet bas)
Create a new instance of this function. |
|
ExtraValueFunction(DbControl dc,
Map<Integer,Integer> extraToIndex)
Create a new instance of this function which can be used to dynamically evaluate expressions. |
Method Summary | |
---|---|
boolean |
checkNumberOfParameters(int n)
|
String |
getFunctionName()
Get the name of this function. |
int |
getNumberOfParameters()
|
void |
run(Stack stack)
|
void |
setCurNumberOfParameters(int n)
|
void |
setSqlResult(SqlResult result)
Set a new SqlResult object that will be used the next time the
JEP expression is evaluated. |
Expression |
toExpression(Node node)
Use the Dynamic.extraValue(ExtraValue) method to create an
expression referencing an extra value. |
Object |
xtra(Integer extraId)
Get the value of the specified extra value of the current sql result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final DbControl dc
private final Map<Integer,Integer> extraToIndex
private final BioAssaySet bas
private int numParameters
private SqlResult result
Constructor Detail |
---|
public ExtraValueFunction(DbControl dc, BioAssaySet bas)
Expression
:s.
dc
- DbControl to use when accessing the databasebas
- Bioassay set for this extra value function.Jep.formulaToExpression(String, JepFunction[])
public ExtraValueFunction(DbControl dc, Map<Integer,Integer> extraToIndex)
dc
- DbControl to use when accessing the databaseextraToIndex
- An map from extra value ID to column indexes in
the SqlResultsetSqlResult(SqlResult)
Method Detail |
---|
public String getFunctionName()
JepFunction
JEP
parser.
getFunctionName
in interface JepFunction
JEP.addFunction(String, PostfixMathCommandI)
public Expression toExpression(Node node)
Dynamic.extraValue(ExtraValue)
method to create an
expression referencing an extra value.
toExpression
in interface JepExpressionFunction
node
- The node representing this function
Expression
objectpublic int getNumberOfParameters()
getNumberOfParameters
in interface org.nfunk.jep.function.PostfixMathCommandI
public void setCurNumberOfParameters(int n)
setCurNumberOfParameters
in interface org.nfunk.jep.function.PostfixMathCommandI
public boolean checkNumberOfParameters(int n)
checkNumberOfParameters
in interface org.nfunk.jep.function.PostfixMathCommandI
public void run(Stack stack) throws ParseException
run
in interface org.nfunk.jep.function.PostfixMathCommandI
ParseException
public void setSqlResult(SqlResult result)
SqlResult
object that will be used the next time the
JEP expression is evaluated.
result
- The result objectpublic Object xtra(Integer extraId) throws ParseException
extraId
- The extra value ID
ParseException
- If no result has been specified or
if no extra value was found.
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |