public class RawChannelFunction extends Object implements JepExpressionFunction
rawCh(int)
function to a
JEP expression parser. The function will look up the (possible transformed)
intensity value for the given channel. For example: rawCh(1)
Note! This function always return the values as they are stored in
the database. Use ChannelFunction
if you need the untransformed
intensity values.
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.
Jep
,
BioAssaySetUtil.createJepExpression(DbControl, String, DynamicQuery)
Modifier and Type | Field and Description |
---|---|
private int[] |
channelToIndex |
private int |
numParameters |
private SqlResult |
result |
Constructor and Description |
---|
RawChannelFunction()
Create a new instance of this function.
|
RawChannelFunction(int[] channelToIndex)
Create a new instance of this function which can be used
to dynamically evaluate expressions.
|
Modifier and Type | Method and Description |
---|---|
Object |
channel(int channel)
Get the value of the specified channel of the current sql result.
|
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.column(VirtualColumn) method to create an
expression referencing a channel intensity. |
private int[] channelToIndex
private SqlResult result
private int numParameters
public RawChannelFunction()
Expression
:s.public RawChannelFunction(int[] channelToIndex)
channelToIndex
- An array that maps channel numbers to column indexes in
the SqlResult, array position 0 maps the index of channel number 1, etc.setSqlResult(SqlResult)
public String getFunctionName()
JepFunction
JEP
parser.getFunctionName
in interface JepFunction
JEP.addFunction(String, PostfixMathCommandI)
public Expression toExpression(Node node)
Dynamic.column(VirtualColumn)
method to create an
expression referencing a channel intensity.toExpression
in interface JepExpressionFunction
node
- The node representing this functionExpression
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 channel(int channel) throws ParseException
channel
- The channel numberParseException
- Either if it's an invalid channel number or
if no result object has been specified.