org.apache.hadoop.io
Class ShortWritable

java.lang.Object
  extended by org.apache.hadoop.io.ShortWritable
All Implemented Interfaces:
Comparable<ShortWritable>, Writable, WritableComparable<ShortWritable>

@InterfaceAudience.Public
@InterfaceStability.Stable
public class ShortWritable
extends Object
implements WritableComparable<ShortWritable>

A WritableComparable for shorts.


Constructor Summary
ShortWritable()
           
ShortWritable(short value)
           
 
Method Summary
 int compareTo(ShortWritable o)
          Compares two ShortWritable.
 boolean equals(Object o)
          Returns true iff o is a ShortWritable with the same value.
 short get()
          Return the value of this ShortWritable.
 int hashCode()
          hash code
 void readFields(DataInput in)
          read the short value
 void set(short value)
          Set the value of this ShortWritable.
 String toString()
          Short values in string format
 void write(DataOutput out)
          write short value
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShortWritable

public ShortWritable()

ShortWritable

public ShortWritable(short value)
Method Detail

set

public void set(short value)
Set the value of this ShortWritable.


get

public short get()
Return the value of this ShortWritable.


readFields

public void readFields(DataInput in)
                throws IOException
read the short value

Specified by:
readFields in interface Writable
Parameters:
in - DataInput to deseriablize this object from.
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
write short value

Specified by:
write in interface Writable
Parameters:
out - DataOuput to serialize this object into.
Throws:
IOException

equals

public boolean equals(Object o)
Returns true iff o is a ShortWritable with the same value.

Overrides:
equals in class Object

hashCode

public int hashCode()
hash code

Overrides:
hashCode in class Object

compareTo

public int compareTo(ShortWritable o)
Compares two ShortWritable.

Specified by:
compareTo in interface Comparable<ShortWritable>

toString

public String toString()
Short values in string format

Overrides:
toString in class Object


Copyright © 2014 Apache Software Foundation. All Rights Reserved.