Class PrefixPattern
java.lang.Object
net.sourceforge.argparse4j.helper.PrefixPattern
This object performs operations related to prefixChars of option flags.
The application code should not use this class directly.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPrefixPattern(String prefixChars) Creates this object using givenprefixChars. -
Method Summary
Modifier and TypeMethodDescriptionprivate static PatterncompilePrefixPattern(String prefixChars) Returns prefixChars with this object constructed.Returns compiled regular expression pattern of prefixChars.booleanReturnstrueif flag stringstrmatches prefixChars.booleanmatchLongFlag(String str) Returnstrueif flag stringstrmatches prefixChars and it is long flag.booleanmatchShortFlag(String str) Returnstrueif flag stringstrmatches prefixChars and it is short flag, that is, its matched prefix length must be 1.removePrefix(String str) Removes prefixChars from given flag string.
-
Field Details
-
prefixChars_
-
prefixPattern_
-
-
Constructor Details
-
PrefixPattern
Creates this object using givenprefixChars.- Parameters:
prefixChars- The prefixChars
-
-
Method Details
-
match
Returnstrueif flag stringstrmatches prefixChars.- Parameters:
str- The flag string to match- Returns:
trueorfalse
-
matchLongFlag
Returnstrueif flag stringstrmatches prefixChars and it is long flag.- Parameters:
str- The flag string to match- Returns:
trueorfalse
-
matchShortFlag
Returnstrueif flag stringstrmatches prefixChars and it is short flag, that is, its matched prefix length must be 1.- Parameters:
str- The flag string to match- Returns:
trueorfalse
-
removePrefix
-
getPrefixChars
Returns prefixChars with this object constructed.- Returns:
- prefixChars
-
getPrefixPattern
Returns compiled regular expression pattern of prefixChars.- Returns:
- The compiled regular expression pattern of prefixChars.
-
compilePrefixPattern
-