Package com.sun.enterprise.admin.cli
Class ArgumentTokenizer
- java.lang.Object
-
- com.sun.enterprise.admin.cli.ArgumentTokenizer
-
public class ArgumentTokenizer extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArgumentTokenizer.ArgumentException
-
Field Summary
Fields Modifier and Type Field Description protected intcurrentPositionprotected intmaxPositionprotected Stringstrprotected StringBuildertoken
-
Constructor Summary
Constructors Constructor Description ArgumentTokenizer(String str)Construct a tokenizer for the specified string.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasMoreTokens()Test if there are more tokens available from this tokenizer's string.StringnextToken()Return the next token from this tokenizer.protected StringscanToken()Return the next token starting at the current position, assuming whitespace has already been skipped.protected voidskipWhiteSpace()Skip white space.
-
-
-
Field Detail
-
currentPosition
protected int currentPosition
-
maxPosition
protected int maxPosition
-
str
protected String str
-
token
protected StringBuilder token
-
-
Constructor Detail
-
ArgumentTokenizer
public ArgumentTokenizer(String str)
Construct a tokenizer for the specified string.- Parameters:
str- a string to be parsed.
-
-
Method Detail
-
skipWhiteSpace
protected void skipWhiteSpace()
Skip white space.
-
hasMoreTokens
public boolean hasMoreTokens()
Test if there are more tokens available from this tokenizer's string.- Returns:
trueif there are more tokens available from this tokenizer's string;falseotherwise.
-
nextToken
public String nextToken() throws ArgumentTokenizer.ArgumentException
Return the next token from this tokenizer.- Returns:
- the next token from this tokenizer.
- Throws:
NoSuchElementException- if there are no more tokens in this tokenizer's string.ArgumentTokenizer.ArgumentException
-
scanToken
protected String scanToken() throws ArgumentTokenizer.ArgumentException
Return the next token starting at the current position, assuming whitespace has already been skipped.
-
-