Package org.apache.hadoop.io
Class FloatWritable
java.lang.Object
org.apache.hadoop.io.FloatWritable
- All Implemented Interfaces:
Comparable<FloatWritable>,Writable,WritableComparable<FloatWritable>
@Public
@Stable
public class FloatWritable
extends Object
implements WritableComparable<FloatWritable>
A WritableComparable for floats.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.io.FloatWritable.ComparatorA Comparator optimized for FloatWritable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares two FloatWritables.booleanReturns true iffois a FloatWritable with the same value.floatget()Return the value of this FloatWritable.inthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidset(float value) Set the value of this FloatWritable.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Constructor Details
-
FloatWritable
public FloatWritable() -
FloatWritable
public FloatWritable(float value)
-
-
Method Details
-
set
public void set(float value) Set the value of this FloatWritable.- Parameters:
value- value.
-
get
public float get()Return the value of this FloatWritable.- Returns:
- value.
-
readFields
Description copied from interface:WritableDeserialize the fields of this object fromin.For efficiency, implementations should attempt to re-use storage in the existing object where possible.
- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
write
Description copied from interface:WritableSerialize the fields of this object toout.- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
equals
Returns true iffois a FloatWritable with the same value. -
hashCode
public int hashCode() -
compareTo
Compares two FloatWritables.- Specified by:
compareToin interfaceComparable<FloatWritable>
-
toString
-