org.apache.hadoop.examples
Class SecondarySort.IntPair
java.lang.Object
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.
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(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