org.apache.hadoop.examples
Class SecondarySort.IntPair

java.lang.Object
  extended by org.apache.hadoop.examples.SecondarySort.IntPair
All Implemented Interfaces:
Comparable<SecondarySort.IntPair>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<SecondarySort.IntPair>
Enclosing class:
SecondarySort

public static class SecondarySort.IntPair
extends Object
implements org.apache.hadoop.io.WritableComparable<SecondarySort.IntPair>

Define a pair of integers that are writable. They are serialized in a byte comparable format.


Nested Class Summary
static class SecondarySort.IntPair.Comparator
          A Comparator that compares serialized IntPair.
 
Constructor Summary
SecondarySort.IntPair()
           
 
Method Summary
 int compareTo(SecondarySort.IntPair o)
           
 boolean equals(Object right)
           
 int getFirst()
           
 int getSecond()
           
 int hashCode()
           
 void readFields(DataInput in)
          Read the two integers.
 void set(int left, int right)
          Set the left and right values.
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SecondarySort.IntPair

public SecondarySort.IntPair()
Method Detail

set

public void set(int left,
                int right)
Set the left and right values.


getFirst

public int getFirst()

getSecond

public int getSecond()

readFields

public void readFields(DataInput in)
                throws IOException
Read the two integers. Encoded as: MIN_VALUE -> 0, 0 -> -MIN_VALUE, MAX_VALUE-> -1

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object right)
Overrides:
equals in class Object

compareTo

public int compareTo(SecondarySort.IntPair o)
Specified by:
compareTo in interface Comparable<SecondarySort.IntPair>


Copyright © 2009 The Apache Software Foundation