de.unkrig.commons.text.scanner
Interface StringScanner<TT extends java.lang.Enum<TT>>
- Type Parameters:
TT -
- All Superinterfaces:
- ProducerWhichThrows<AbstractScanner.Token<TT>,ScanException>
- All Known Implementing Classes:
- AbstractScanner, StatefulScanner, StatelessScanner
public interface StringScanner<TT extends java.lang.Enum<TT>>
- extends ProducerWhichThrows<AbstractScanner.Token<TT>,ScanException>
A scanner which has a notion of an 'offset' where the previously scanned token starts.
setInput
StringScanner<TT> setInput(java.lang.CharSequence cs)
- Parameters:
cs - The CharSequence from which following calls to ProducerWhichThrows.produce() will scan tokens
- Returns:
- This scanner
getOffset
int getOffset()
- Returns:
- The offset within the input string set through
setInput(CharSequence) where the previously
scanned token ends, or 0 after the call to setInput(CharSequence) and before the first
call to ProducerWhichThrows.produce()
getPreviousTokenOffset
int getPreviousTokenOffset()
- Returns:
- The offset within the input string set through
setInput(CharSequence) where the previously
scanned token begins, or -1 after the call to setInput(CharSequence) and before the first
call to ProducerWhichThrows.produce()