|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--tauzaman.io.FormatParser
FormatParser
class tokenizes given Format
content to its variables and non-variables. Variables are String sequences
, which matches with regular expression, "$[a-zA-Z]+" . Non-variables
are the String tokens that are left when variables are fetched.
"$month $year $day" => "$month", " ", "$year", " ", "$day"
Field Summary | |
private java.lang.String |
input
String input that will be tokenized |
private java.util.regex.Matcher |
matcher
Matcher class of java.util.regex, that will be used when finding variable patterns in input string |
private java.util.regex.Pattern |
pattern
Pattern class of java.util.regex, that will be used when finding variable patterns in input string |
private java.lang.String |
varPattern
|
Constructor Summary | |
protected |
FormatParser(java.lang.String input)
Constructs a FormatParser object, which is ready to parse
given input. |
Method Summary | |
protected java.lang.String[] |
parseFormat(boolean variablesOnly)
Returns tokens, which are resulted from parsing process. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String input
private java.lang.String varPattern
private java.util.regex.Pattern pattern
private java.util.regex.Matcher matcher
Constructor Detail |
protected FormatParser(java.lang.String input)
FormatParser
object, which is ready to parse
given input.
input
- String, which will be tokenized into its tokensMethod Detail |
protected java.lang.String[] parseFormat(boolean variablesOnly)
variablesOnly
- a boolean variable, which determines if
all tokens or just variable tokens will be returned
|
tauZaman v0.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |