public final class FloatingPointGroup extends Group
AMPERSAND, ANYTHING, ANYTHING_NON_EMPTY, AT_SIGN, BACKSLASH, COLON, COMMA, DASH, DIGIT, DIGITS, DOLLAR_SIGN, DOT, DOUBLE_QUOTED_STRING, EQUALS, EXCLAMATION_POINT, FLOATING_POINT_NUMBER, HEXADECIMAL_DIGIT, HEXADECIMAL_DIGITS, INTEGER, LEFT_CURLY, LEFT_PAREN, LEFT_SQUARE, MINUS, NON_WORD, OPTIONAL_STRING, OPTIONAL_WHITESPACE, OPTIONAL_WORD, PERCENT, PERL_INTERPOLATION, PIPE, PLUS, POSITIVE_INTEGER, POUND_SIGN, RIGHT_CURLY, RIGHT_PAREN, RIGHT_SQUARE, SEMICOLON, SLASH, STAR, STRING, TILDE, UNDERSCORE, VARIABLE_NAME, WHITESPACE, WORD, XML_ATTRIBUTE_NAME, XML_ELEMENT_NAME
Constructor and Description |
---|
FloatingPointGroup()
Constructs an FloatingPointGroup that parses Strings that match the FLOATING_POINT_NUMBER
pattern.
|
Modifier and Type | Method and Description |
---|---|
double |
getDouble(Matcher matcher) |
double |
getDouble(Matcher matcher,
double defaultValue)
Gets double by parsing the String matched by this capturing group.
|
float |
getFloat(Matcher matcher) |
float |
getFloat(Matcher matcher,
float defaultValue)
Gets float by parsing the String matched by this capturing group.
|
matcher, matcher, pattern, pattern
public FloatingPointGroup()
MetaPattern.FLOATING_POINT_NUMBER
public float getFloat(Matcher matcher)
matcher
- The matcherpublic float getFloat(Matcher matcher, float defaultValue)
matcher
- The matcherdefaultValue
- The default value to use if this group is omitted because it is optionalpublic double getDouble(Matcher matcher)
matcher
- The matcherpublic double getDouble(Matcher matcher, double defaultValue)
matcher
- The matcherdefaultValue
- The default value to use if this group is omitted because it is optionalCopyright © 2006–2022 Apache Software Foundation. All rights reserved.