public class FormulaScanner
extends java.lang.Object
FormulaScanner
scans formula text and returns tokens.Modifier and Type | Class | Description |
---|---|---|
static class |
FormulaScanner.Token |
Enumeration for the different types of Tokens in Formulas.
|
Constructor | Description |
---|---|
FormulaScanner() |
Construct a
FormulaScanner object, with empty input. |
FormulaScanner(java.lang.String formulaText) |
Construct a
FormulaScanner object, with the given input. |
Modifier and Type | Method | Description |
---|---|---|
java.lang.String |
getCurrLexeme() |
Returns the current lexeme after a call to
getNextToken . |
FormulaScanner.Token |
getNextToken() |
Returns the
Token . |
void |
reset() |
Resets the scanner to the beginning of the formula text.
|
void |
setFormulaText(java.lang.String formulaText) |
Give the
FormulaScanner another formula text to scan. |
public FormulaScanner()
FormulaScanner
object, with empty input.public FormulaScanner(java.lang.String formulaText)
FormulaScanner
object, with the given input.formulaText
- The formula text to scan.public FormulaScanner.Token getNextToken()
Token
. After this call completes, the current
lexeme is available via a call to getCurrLexeme
.
Starts looking at the current offset, and once the token is found, then
the offset is advanced to the start of the next token.Token
.getCurrLexeme()
public java.lang.String getCurrLexeme()
getNextToken
.null
if
getNextToken
hasn't been called yet after a reset.getNextToken()
,
reset()
public void reset()
public void setFormulaText(java.lang.String formulaText)
FormulaScanner
another formula text to scan.
Resets to the beginning of the string.formulaText
- The formula text to scan.Copyright © 2012–2018 Jett Team. All rights reserved.