Package net.sf.basedb.util.parser
Class DataNoFunction
java.lang.Object
net.sf.basedb.util.parser.DataNoFunction
- All Implemented Interfaces:
JepFunction
,org.nfunk.jep.function.PostfixMathCommandI
Adds a
dataNo()
function to Jep. The dataNo() function is used with the
FlatFileParser
to get the current data line number within a section. Use the
FlatFileParser.getMapper(String)
with an argument starting with an equal
sign to create a mapper that uses Jep.
FlatFileParser ffp = ... Mapper dataNoMapper = ffp.getMapper("=dataNo()"); while (ffp.hasMoreData()) { Data data = ffp.nextData(); int lineNumber = dataNoMapper.getInt(data); }
- Version:
- 2.4
- Author:
- nicklas
- Last modified
- $Date: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
checkNumberOfParameters
(int n) Get the name of this function.int
void
void
setCurNumberOfParameters
(int n) void
setData
(FlatFileParser.Data data)
-
Field Details
-
data
-
-
Constructor Details
-
DataNoFunction
public DataNoFunction()
-
-
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 "dataNo"
- See Also:
-
getNumberOfParameters
public int getNumberOfParameters()- Specified by:
getNumberOfParameters
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
- Returns:
- Always 0
-
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
- Specified by:
run
in interfaceorg.nfunk.jep.function.PostfixMathCommandI
- Throws:
ParseException
-
setData
-