Class DoubleValue

    • Constructor Detail

      • DoubleValue

        public DoubleValue()
        Initializes the encapsulated double with 0.0.
      • DoubleValue

        public DoubleValue​(double value)
        Initializes the encapsulated double with the provided value.
        Parameters:
        value - Initial value of the encapsulated double.
    • Method Detail

      • getValue

        public double getValue()
        Returns the value of the encapsulated primitive double.
        Returns:
        the value of the encapsulated primitive double.
      • setValue

        public void setValue​(double value)
        Sets the value of the encapsulated primitive double.
        Parameters:
        value - the new value of the encapsulated primitive double.
      • read

        public void read​(DataInputView in)
                  throws IOException
        Description copied from interface: IOReadableWritable
        Reads the object's internal data from the given data input view.
        Specified by:
        read in interface IOReadableWritable
        Parameters:
        in - the input view to read the data from
        Throws:
        IOException - thrown if any error occurs while reading from the input stream
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getBinaryLength

        public int getBinaryLength()
        Description copied from interface: CopyableValue
        Gets the length of the data type when it is serialized, in bytes.
        Specified by:
        getBinaryLength in interface CopyableValue<DoubleValue>
        Returns:
        The length of the data type, or -1, if variable length.
      • copyTo

        public void copyTo​(DoubleValue target)
        Description copied from interface: CopyableValue
        Performs a deep copy of this object into the target instance.
        Specified by:
        copyTo in interface CopyableValue<DoubleValue>
        Parameters:
        target - Object to copy into.
      • copy

        public DoubleValue copy()
        Description copied from interface: CopyableValue
        Performs a deep copy of this object into a new instance.

        This method is useful for generic user-defined functions to clone a CopyableValue when storing multiple objects. With object reuse a deep copy must be created and type erasure prevents calling new.

        Specified by:
        copy in interface CopyableValue<DoubleValue>
        Returns:
        New object with copied fields.
      • copy

        public void copy​(DataInputView source,
                         DataOutputView target)
                  throws IOException
        Description copied from interface: CopyableValue
        Copies the next serialized instance from source to target.

        This method is equivalent to calling IOReadableWritable.read(DataInputView) followed by IOReadableWritable.write(DataOutputView) but does not require intermediate deserialization.

        Specified by:
        copy in interface CopyableValue<DoubleValue>
        Parameters:
        source - Data source for serialized instance.
        target - Data target for serialized instance.
        Throws:
        IOException
        See Also:
        IOReadableWritable