|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jimmc.util.QuoteTokenizer
Tokenize a String which may contain quoted strings.
Field Summary | |
static char |
INTRAQUOTER
Our character-quoting character within a string. |
protected int |
len
The length of the line being parsed. |
protected java.lang.String |
line
The string we are parsing. |
protected int |
pos
The position at which to start parsing on the next call to nextToken() . |
protected java.lang.StringBuffer |
qbuf
A buffer we use while parsing a quoted string. |
protected boolean |
quoted
True if the string most recently returned by nextToken()
was a quoted string. |
static char |
QUOTER
Our string quoting character. |
Constructor Summary | |
QuoteTokenizer()
Create a tokenizer. |
|
QuoteTokenizer(java.lang.String line)
Create a tokenizer for a string. |
Method Summary | |
protected java.lang.String |
getIdentifier()
Parse out an identifier string. |
protected java.lang.Number |
getNumber()
Get a number string. |
protected java.lang.String |
getQuoted()
Parse out a quoted string. |
protected boolean |
isIdentiferPart(char c)
True if this character can be in an identifier. |
protected boolean |
isIdentifierStart(char c)
True if this character starts an identifier. |
protected boolean |
isNumberPart(char c)
True if this character can be part of a number. |
protected boolean |
isNumberStart(char c)
True if this character starts a number. |
protected boolean |
isQuotedStart(char c)
True if this character starts a quoted string. |
java.lang.Object |
nextToken()
Return the next token. |
void |
setInput(java.lang.String line)
Set the string to be parsed. |
protected void |
skipWhitespace()
Skip white space. |
protected java.lang.Number |
stringToNumber(java.lang.String s)
Convert a string representation of a number to a Number. |
boolean |
wasQuoted()
True if the string most recently returned by nextToken()
was quoted. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final char QUOTER
public static final char INTRAQUOTER
protected java.lang.String line
protected int len
protected int pos
nextToken()
.protected boolean quoted
nextToken()
was a quoted string.wasQuoted()
protected java.lang.StringBuffer qbuf
Constructor Detail |
public QuoteTokenizer()
setInput(java.lang.String)
public QuoteTokenizer(java.lang.String line)
Method Detail |
public void setInput(java.lang.String line)
public java.lang.Object nextToken()
wasQuoted()
will return true.protected void skipWhitespace()
protected boolean isQuotedStart(char c)
protected boolean isIdentifierStart(char c)
protected boolean isIdentiferPart(char c)
protected boolean isNumberStart(char c)
protected boolean isNumberPart(char c)
protected java.lang.String getQuoted()
protected java.lang.String getIdentifier()
protected java.lang.Number getNumber()
protected java.lang.Number stringToNumber(java.lang.String s)
public boolean wasQuoted()
nextToken()
was quoted.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |