Package sleep.parser
Class StringIterator
- java.lang.Object
-
- sleep.parser.StringIterator
-
public class StringIterator extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description StringIterator(java.lang.String text)StringIterator(java.lang.String _text, int _lineNo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEntireLine()TokengetErrorToken()intgetLineMarker()intgetLineNumber()booleanhasNext()check that there is another character out there for us to getbooleanhasNext(int n)check that there are at least n chars we can still getbooleanisNextChar(char n)booleanisNextString(java.lang.String n)static voidmain(java.lang.String[] args)voidmark()charnext()moves the iterator forward one charjava.lang.Stringnext(int n)returns the string consisting of the next n characters.charpeek()java.lang.Stringreset()voidskip(int n)does a direct skip of n characters, use only when you know what the chars are..java.lang.StringtoString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hasNext
public boolean hasNext()
check that there is another character out there for us to get
-
hasNext
public boolean hasNext(int n)
check that there are at least n chars we can still get
-
getLineNumber
public int getLineNumber()
-
getErrorToken
public Token getErrorToken()
-
getEntireLine
public java.lang.String getEntireLine()
-
getLineMarker
public int getLineMarker()
-
isNextString
public boolean isNextString(java.lang.String n)
-
isNextChar
public boolean isNextChar(char n)
-
peek
public char peek()
-
skip
public void skip(int n)
does a direct skip of n characters, use only when you know what the chars are.. this will not increment the line number counter
-
next
public java.lang.String next(int n)
returns the string consisting of the next n characters.
-
next
public char next()
moves the iterator forward one char
-
mark
public void mark()
-
reset
public java.lang.String reset()
-
main
public static void main(java.lang.String[] args)
-
-