org.apache.hadoop.examples
Class SecondarySort.IntPair
java.lang.Object
org.apache.hadoop.examples.SecondarySort.IntPair
- All Implemented Interfaces:
- java.lang.Comparable<SecondarySort.IntPair>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<SecondarySort.IntPair>
- Enclosing class:
- SecondarySort
public static class SecondarySort.IntPair
- extends java.lang.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.
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
SecondarySort.IntPair
public SecondarySort.IntPair()
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(java.io.DataInput in)
throws java.io.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:
java.io.IOException
write
public void write(java.io.DataOutput out)
throws java.io.IOException
- Specified by:
write
in interface org.apache.hadoop.io.Writable
- Throws:
java.io.IOException
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object right)
- Overrides:
equals
in class java.lang.Object
compareTo
public int compareTo(SecondarySort.IntPair o)
- Specified by:
compareTo
in interface java.lang.Comparable<SecondarySort.IntPair>
Copyright © 2009 The Apache Software Foundation