Package org.apache.hadoop.io
Class IntWritable
java.lang.Object
org.apache.hadoop.io.IntWritable
- All Implemented Interfaces:
Comparable<IntWritable>,Writable,WritableComparable<IntWritable>
A WritableComparable for ints.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.io.IntWritable.ComparatorA Comparator optimized for IntWritable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares two IntWritables.booleanReturns true iffois a IntWritable with the same value.intget()Return the value of this IntWritable.inthashCode()voidreadFields(DataInput in) Deserialize the fields of this object fromin.voidset(int value) Set the value of this IntWritable.toString()voidwrite(DataOutput out) Serialize the fields of this object toout.
-
Constructor Details
-
IntWritable
public IntWritable() -
IntWritable
public IntWritable(int value)
-
-
Method Details
-
set
public void set(int value) Set the value of this IntWritable.- Parameters:
value- input value.
-
get
public int get()Return the value of this IntWritable.- Returns:
- value of this IntWritable.
-
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 IntWritable with the same value. -
hashCode
public int hashCode() -
compareTo
Compares two IntWritables.- Specified by:
compareToin interfaceComparable<IntWritable>
-
toString
-