public class MiniScanner extends Object
| Constructor and Description |
|---|
MiniScanner() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept()
Move past the "current" character to the next one; return false if eof.
|
boolean |
copy()
Accept the current character and copy it to the buffer; return eof if we are at eof after the accept.
|
void |
copy(int i) |
boolean |
eof()
Return T if at eof.
|
boolean |
eofSkipWS()
Returns T if all that is left is whitespace before eof.
|
static MiniScanner |
getInstance()
Get a miniscanner instance.
|
String |
getStringResult()
Returns the string built in the buffer and clears the buffer in the process.
|
void |
init(String in)
Reset the scanner for a next string to scan.
|
int |
LA()
Return the character at the current location, or -1 if at end of the string.
|
int |
LA(int ix)
Return the nth char after the current location, or -1 if that is past the end of the string.
|
boolean |
match(String s) |
long |
scanDuration(String in) |
boolean |
scanLaxNumber(String input,
int scale,
boolean useStrictScale)
Does LAX Scanning on input using numeric (non monetary) values parser.
|
boolean |
scanLaxWithCurrencySign(String in,
int scale,
boolean useStrictScale)
Scans the input as a lax euro string and leave the buffer to hold
a parseable numeric string for one of the to-java-type converters.
|
boolean |
skip(char c)
If the current character equals the specified one skip it by accept() and return true, else
do nothing and return false.
|
void |
skipWs()
Skip till the 1st non-ws character.
|
int |
val()
Returns the last integer "value" scanned.
|
public static MiniScanner getInstance()
public void init(String in)
in - public int LA()
public int LA(int ix)
ix - public boolean accept()
public boolean copy()
public void copy(int i)
public boolean skip(char c)
c - public boolean eof()
public String getStringResult()
public boolean eofSkipWS()
public boolean scanLaxWithCurrencySign(String in, int scale, boolean useStrictScale) throws ValidationException
ValidationExceptionpublic boolean scanLaxNumber(String input, int scale, boolean useStrictScale) throws ValidationException
input - scale - useStrictScale - ValidationExceptionpublic int val()
public long scanDuration(String in)
public void skipWs()
public boolean match(String s)
Copyright © 2017 etc.to. All rights reserved.