Package monq.jfa
Class StringCharSource
java.lang.Object
monq.jfa.StringCharSource
- All Implemented Interfaces:
CharSource
A
CharSource for a String or a part of it.-
Constructor Summary
ConstructorsConstructorDescriptionStringCharSource(String text) StringCharSource(String text, int start, int length) -
Method Summary
Modifier and TypeMethodDescriptionintResets this to a previously setCharSource.mark().voidmark()Sets a mark until which we may want to skip back withCharSource.backToMark()to re-read part of the input.intread()returns a single character or -1 to indicate end of file.
-
Constructor Details
-
StringCharSource
-
StringCharSource
-
-
Method Details
-
read
Description copied from interface:CharSourcereturns a single character or -1 to indicate end of file.- Specified by:
readin interfaceCharSource- Throws:
IOException
-
mark
public void mark()Description copied from interface:CharSourceSets a mark until which we may want to skip back withCharSource.backToMark()to re-read part of the input. The initial mark is always at the start of the input, so that after a call tobackToMarkthe wholeCharSourcecan be re-read.- Specified by:
markin interfaceCharSource
-
backToMark
public int backToMark()Description copied from interface:CharSourceResets this to a previously setCharSource.mark().- Specified by:
backToMarkin interfaceCharSource
-