public class LineNoFunction extends Object implements JepFunction
lineNo()
function to Jep. The lineNo() function is used with the
FlatFileParser
to get the current line number. Use the
FlatFileParser.getMapper(String)
with an argument starting with an equal
sign to create a mapper that uses Jep.
FlatFileParser ffp = ... Mapper lineNoMapper = ffp.getMapper("=lineNo()"); while (ffp.hasMoreData()) { Data data = ffp.nextData(); int lineNumber = lineNoMapper.getInt(data); }
Modifier and Type | Field and Description |
---|---|
private FlatFileParser.Data |
data |
Constructor and Description |
---|
LineNoFunction() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkNumberOfParameters(int n) |
String |
getFunctionName()
Get the name of this function.
|
int |
getNumberOfParameters() |
void |
run(Stack stack) |
void |
setCurNumberOfParameters(int n) |
void |
setData(FlatFileParser.Data data) |
private FlatFileParser.Data data
public String getFunctionName()
JepFunction
JEP
parser.getFunctionName
in interface JepFunction
JEP.addFunction(String, PostfixMathCommandI)
public 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 setData(FlatFileParser.Data data)