Class DoubleParser

    • Constructor Detail

      • DoubleParser

        public DoubleParser()
    • Method Detail

      • parseField

        public int parseField​(byte[] bytes,
                              int startPos,
                              int limit,
                              byte[] delimiter,
                              Double reusable)
        Description copied from class: FieldParser
        Each parser's logic should be implemented inside this method
        Specified by:
        parseField in class FieldParser<Double>
      • createValue

        public Double createValue()
        Description copied from class: FieldParser
        Returns an instance of the parsed value type.
        Specified by:
        createValue in class FieldParser<Double>
        Returns:
        An instance of the parsed value type.
      • parseField

        public static final double parseField​(byte[] bytes,
                                              int startPos,
                                              int length)
        Static utility to parse a field of type double from a byte sequence that represents text characters (such as when read from a file stream).
        Parameters:
        bytes - The bytes containing the text data that should be parsed.
        startPos - The offset to start the parsing.
        length - The length of the byte sequence (counting from the offset).
        Returns:
        The parsed value.
        Throws:
        IllegalArgumentException - Thrown when the value cannot be parsed because the text represents not a correct number.
      • parseField

        public static final double parseField​(byte[] bytes,
                                              int startPos,
                                              int length,
                                              char delimiter)
        Static utility to parse a field of type double from a byte sequence that represents text characters (such as when read from a file stream).
        Parameters:
        bytes - The bytes containing the text data that should be parsed.
        startPos - The offset to start the parsing.
        length - The length of the byte sequence (counting from the offset).
        delimiter - The delimiter that terminates the field.
        Returns:
        The parsed value.
        Throws:
        IllegalArgumentException - Thrown when the value cannot be parsed because the text represents not a correct number.