@Public public class DoubleValue extends Object implements Comparable<DoubleValue>, ResettableValue<DoubleValue>, CopyableValue<DoubleValue>, Key<DoubleValue>
double.| Constructor and Description |
|---|
DoubleValue()
Initializes the encapsulated double with 0.0.
|
DoubleValue(double value)
Initializes the encapsulated double with the provided value.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(DoubleValue o) |
DoubleValue |
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(DoubleValue 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.
|
double |
getValue()
Returns the value of the encapsulated primitive double.
|
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(double value)
Sets the value of the encapsulated primitive double.
|
void |
setValue(DoubleValue 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 DoubleValue()
public DoubleValue(double value)
value - Initial value of the encapsulated double.public double getValue()
public void setValue(double value)
value - the new value of the encapsulated primitive double.public void setValue(DoubleValue value)
ResettableValuesetValue in interface ResettableValue<DoubleValue>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(DoubleValue o)
compareTo in interface Comparable<DoubleValue>public int hashCode()
KeyhashCode in interface Key<DoubleValue>hashCode in class Objectpublic boolean equals(Object obj)
Keyequals in interface Key<DoubleValue>equals in class Objectobj - The other object to compare against.public int getBinaryLength()
CopyableValuegetBinaryLength in interface CopyableValue<DoubleValue>-1, if variable length.public void copyTo(DoubleValue target)
CopyableValuetarget instance.copyTo in interface CopyableValue<DoubleValue>target - Object to copy into.public DoubleValue 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<DoubleValue>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<DoubleValue>source - Data source for serialized instance.target - Data target for serialized instance.IOExceptionIOReadableWritableCopyright © 2014–2018 The Apache Software Foundation. All rights reserved.