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.String
getEntireLine()
Token
getErrorToken()
int
getLineMarker()
int
getLineNumber()
boolean
hasNext()
check that there is another character out there for us to getboolean
hasNext(int n)
check that there are at least n chars we can still getboolean
isNextChar(char n)
boolean
isNextString(java.lang.String n)
static void
main(java.lang.String[] args)
void
mark()
char
next()
moves the iterator forward one charjava.lang.String
next(int n)
returns the string consisting of the next n characters.char
peek()
java.lang.String
reset()
void
skip(int n)
does a direct skip of n characters, use only when you know what the chars are..java.lang.String
toString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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)
-
-