Class FloatingPointGroup

  • All Implemented Interfaces:
    java.io.Serializable, IClusterable

    public final class FloatingPointGroup
    extends Group
    A Group that captures floating point values (doubles and floats).
    Author:
    Jonathan Locke
    See Also:
    Serialized Form
    • Constructor Detail

      • FloatingPointGroup

        public FloatingPointGroup()
        Constructs an FloatingPointGroup that parses Strings that match the FLOATING_POINT_NUMBER pattern.
        See Also:
        MetaPattern.FLOATING_POINT_NUMBER
    • Method Detail

      • getFloat

        public float getFloat​(java.util.regex.Matcher matcher)
        Parameters:
        matcher - The matcher
        Returns:
        The value
      • getFloat

        public float getFloat​(java.util.regex.Matcher matcher,
                              float defaultValue)
        Gets float by parsing the String matched by this capturing group.
        Parameters:
        matcher - The matcher
        defaultValue - The default value to use if this group is omitted because it is optional
        Returns:
        The parsed value
      • getDouble

        public double getDouble​(java.util.regex.Matcher matcher)
        Parameters:
        matcher - The matcher
        Returns:
        The value
      • getDouble

        public double getDouble​(java.util.regex.Matcher matcher,
                                double defaultValue)
        Gets double by parsing the String matched by this capturing group.
        Parameters:
        matcher - The matcher
        defaultValue - The default value to use if this group is omitted because it is optional
        Returns:
        The parsed value