Class StringParser
- java.lang.Object
-
- org.glassfish.pfl.basic.tools.file.StringParser
-
public class StringParser extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description StringParser(java.lang.String str)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private booleannext()java.lang.StringparseInt()Return int matched at current position as a string.private voidsetPos(int newPos)booleanskipString(java.lang.String str)skip over str, if str is at the current position.booleanskipToString(java.lang.String str)skip everything until str is found.booleanskipWhitespace()Skip over whitespace.
-
-
-
Method Detail
-
setPos
private void setPos(int newPos)
-
next
private boolean next()
-
skipToString
public boolean skipToString(java.lang.String str)
skip everything until str is found. Returns true if found, otherwise false.- Parameters:
str- String for which we are looking- Returns:
- whether or not str was found
-
skipString
public boolean skipString(java.lang.String str)
skip over str, if str is at the current position.- Parameters:
str- to skip (must be at current position)- Returns:
- whether or not str was at current position
-
skipWhitespace
public boolean skipWhitespace()
Skip over whitespace. Returns true if some whitespace skipped.- Returns:
- whether some whitespace was skipped.
-
parseInt
public java.lang.String parseInt()
Return int matched at current position as a string.
-
-