public class PrefixPattern extends Object
This object performs operations related to prefixChars of option flags.
The application code should not use this class directly.
| Constructor and Description |
|---|
PrefixPattern(String prefixChars)
Creates this object using given
prefixChars. |
| Modifier and Type | Method and Description |
|---|---|
String |
getPrefixChars()
Returns prefixChars with this object constructed.
|
Pattern |
getPrefixPattern()
Returns compiled regular expression pattern of prefixChars.
|
boolean |
match(String str)
Returns
true if flag string str matches prefixChars. |
boolean |
matchLongFlag(String str)
Returns
true if flag string str matches prefixChars and
it is long flag. |
String |
removePrefix(String str)
Removes prefixChars from given flag string.
|
public PrefixPattern(String prefixChars)
prefixChars.prefixChars - The prefixCharspublic boolean match(String str)
true if flag string str matches prefixChars.str - The flag string to matchtrue or falsepublic boolean matchLongFlag(String str)
true if flag string str matches prefixChars and
it is long flag.str - The flag string to matchtrue or falsepublic String removePrefix(String str)
Removes prefixChars from given flag string.
If given flag string does not contains prefixChars, it is returned as is.
str - The flag stringstrpublic String getPrefixChars()
public Pattern getPrefixPattern()
Copyright © 2012–2015. All rights reserved.