Package org.apache.hadoop.io
Class ShortWritable
java.lang.Object
org.apache.hadoop.io.ShortWritable
- All Implemented Interfaces:
Comparable<ShortWritable>,Writable,WritableComparable<ShortWritable>
@Public
@Stable
public class ShortWritable
extends Object
implements WritableComparable<ShortWritable>
A WritableComparable for shorts.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classorg.apache.hadoop.io.ShortWritable.ComparatorA Comparator optimized for ShortWritable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares two ShortWritable.booleanReturns true iffois a ShortWritable with the same value.shortget()inthashCode()hash codevoidreadFields(DataInput in) read the short valuevoidset(short value) Set the value of this ShortWritable.toString()Short values in string formatvoidwrite(DataOutput out) write short value
-
Constructor Details
-
ShortWritable
public ShortWritable() -
ShortWritable
public ShortWritable(short value)
-
-
Method Details
-
set
public void set(short value) Set the value of this ShortWritable.- Parameters:
value- input value.
-
get
public short get()- Returns:
- Return the value of this ShortWritable.
-
readFields
read the short value- Specified by:
readFieldsin interfaceWritable- Parameters:
in-DataInputto deseriablize this object from.- Throws:
IOException- any other problem for readFields.
-
write
write short value- Specified by:
writein interfaceWritable- Parameters:
out-DataOuputto serialize this object into.- Throws:
IOException- any other problem for write.
-
equals
Returns true iffois a ShortWritable with the same value. -
hashCode
public int hashCode()hash code -
compareTo
Compares two ShortWritable.- Specified by:
compareToin interfaceComparable<ShortWritable>
-
toString
Short values in string format
-