@Public public class FloatValue extends Object implements Comparable<FloatValue>, ResettableValue<FloatValue>, CopyableValue<FloatValue>, Key<FloatValue>
float.| Constructor and Description |
|---|
FloatValue()
Initializes the encapsulated float with 0.0.
|
FloatValue(float value)
Initializes the encapsulated float with the provided value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(FloatValue o) |
FloatValue |
copy()
Performs a deep copy of this object into a new instance.
|
void |
copy(DataInputView source,
DataOutputView target)
Copies the next serialized instance from
source to target. |
void |
copyTo(FloatValue target)
Performs a deep copy of this object into the
target instance. |
boolean |
equals(Object obj)
Compares the object on equality with another object.
|
int |
getBinaryLength()
Gets the length of the data type when it is serialized, in bytes.
|
float |
getValue()
Returns the value of the encapsulated primitive float.
|
int |
hashCode()
All keys must override the hash-code function to generate proper deterministic hash codes,
based on their contents.
|
void |
read(DataInputView in)
Reads the object's internal data from the given data input view.
|
void |
setValue(float value)
Sets the value of the encapsulated primitive float.
|
void |
setValue(FloatValue value)
Sets the encapsulated value to another value
|
String |
toString() |
void |
write(DataOutputView out)
Writes the object's internal data to the given data output view.
|
public FloatValue()
public FloatValue(float value)
value - Initial value of the encapsulated float.public float getValue()
public void setValue(float value)
value - the new value of the encapsulated primitive float.public void setValue(FloatValue value)
ResettableValuesetValue in interface ResettableValue<FloatValue>value - the new value of the encapsulated valuepublic void read(DataInputView in) throws IOException
IOReadableWritableread in interface IOReadableWritablein - the input view to read the data fromIOException - thrown if any error occurs while reading from the input streampublic void write(DataOutputView out) throws IOException
IOReadableWritablewrite in interface IOReadableWritableout - the output view to receive the data.IOException - thrown if any error occurs while writing to the output streampublic int compareTo(FloatValue o)
compareTo in interface Comparable<FloatValue>public int hashCode()
KeyhashCode in interface Key<FloatValue>hashCode in class Objectpublic boolean equals(Object obj)
Keyequals in interface Key<FloatValue>equals in class Objectobj - The other object to compare against.public int getBinaryLength()
CopyableValuegetBinaryLength in interface CopyableValue<FloatValue>-1, if variable length.public void copyTo(FloatValue target)
CopyableValuetarget instance.copyTo in interface CopyableValue<FloatValue>target - Object to copy into.public FloatValue copy()
CopyableValueCopyableValue when storing multiple objects. With object reuse
a deep copy must be created and type erasure prevents calling new.copy in interface CopyableValue<FloatValue>public void copy(DataInputView source, DataOutputView target) throws IOException
CopyableValuesource to target.
This method is equivalent to calling IOReadableWritable.read(DataInputView)
followed by IOReadableWritable.write(DataOutputView) but does not require
intermediate deserialization.copy in interface CopyableValue<FloatValue>source - Data source for serialized instance.target - Data target for serialized instance.IOExceptionIOReadableWritableCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.