Class FloatValue

    • Constructor Detail

      • FloatValue

        public FloatValue()
        Initializes the encapsulated float with 0.0.
      • FloatValue

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

      • getValue

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

        public void setValue​(float value)
        Sets the value of the encapsulated primitive float.
        Parameters:
        value - the new value of the encapsulated primitive float.
      • 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()
        Description copied from interface: Key
        All keys must override the hash-code function to generate proper deterministic hash codes, based on their contents.
        Specified by:
        hashCode in interface Key<FloatValue>
        Overrides:
        hashCode in class Object
        Returns:
        The hash code of the key
      • equals

        public boolean equals​(Object obj)
        Description copied from interface: Key
        Compares the object on equality with another object.
        Specified by:
        equals in interface Key<FloatValue>
        Overrides:
        equals in class Object
        Parameters:
        obj - The other object to compare against.
        Returns:
        True, iff this object is identical to the other object, false otherwise.
      • 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<FloatValue>
        Returns:
        The length of the data type, or -1, if variable length.
      • copyTo

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

        public FloatValue 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<FloatValue>
        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<FloatValue>
        Parameters:
        source - Data source for serialized instance.
        target - Data target for serialized instance.
        Throws:
        IOException
        See Also:
        IOReadableWritable