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 Classes
    Modifier and Type
    Class
    Description
    static class 
    org.apache.hadoop.io.ShortWritable.Comparator
    A Comparator optimized for ShortWritable.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ShortWritable(short value)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares two ShortWritable.
    boolean
    Returns true iff o is a ShortWritable with the same value.
    short
    get()
     
    int
    hash code
    void
    read the short value
    void
    set(short value)
    Set the value of this ShortWritable.
    Short values in string format
    void
    write short value

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • 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

      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 - any other problem for readFields.
    • 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 - any other problem for write.
    • 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