org.apache.mahout.common
Class IntPairWritable

java.lang.Object
  extended by org.apache.hadoop.io.BinaryComparable
      extended by org.apache.mahout.common.IntPairWritable
All Implemented Interfaces:
Cloneable, Comparable<org.apache.hadoop.io.BinaryComparable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<org.apache.hadoop.io.BinaryComparable>

public final class IntPairWritable
extends org.apache.hadoop.io.BinaryComparable
implements org.apache.hadoop.io.WritableComparable<org.apache.hadoop.io.BinaryComparable>, Cloneable

A WritableComparable which encapsulates an ordered pair of signed integers.


Nested Class Summary
static class IntPairWritable.Comparator
           
static class IntPairWritable.FirstGroupingComparator
          Compare only the first part of the pair, so that reduce is called once for each value of the first part.
static class IntPairWritable.Frequency
          A wrapper class that associates pairs with frequency (Occurrences)
 
Constructor Summary
IntPairWritable()
           
IntPairWritable(int x, int y)
           
IntPairWritable(IntPairWritable pair)
           
 
Method Summary
 Object clone()
           
 int compareTo(org.apache.hadoop.io.BinaryComparable other)
           
 boolean equals(Object obj)
           
 byte[] getBytes()
           
 int getFirst()
           
 int getLength()
           
 int getSecond()
           
 int hashCode()
           
 void readFields(DataInput in)
           
 void set(int x, int y)
           
 void setFirst(int x)
           
 void setSecond(int y)
           
 String toString()
           
 void write(DataOutput out)
           
 
Methods inherited from class org.apache.hadoop.io.BinaryComparable
compareTo
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IntPairWritable

public IntPairWritable()

IntPairWritable

public IntPairWritable(IntPairWritable pair)

IntPairWritable

public IntPairWritable(int x,
                       int y)
Method Detail

set

public void set(int x,
                int y)

setFirst

public void setFirst(int x)

getFirst

public int getFirst()

setSecond

public void setSecond(int y)

getSecond

public int getSecond()

readFields

public void readFields(DataInput in)
                throws IOException
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 org.apache.hadoop.io.BinaryComparable

equals

public boolean equals(Object obj)
Overrides:
equals in class org.apache.hadoop.io.BinaryComparable

compareTo

public int compareTo(org.apache.hadoop.io.BinaryComparable other)
Specified by:
compareTo in interface Comparable<org.apache.hadoop.io.BinaryComparable>
Overrides:
compareTo in class org.apache.hadoop.io.BinaryComparable

clone

public Object clone()
Overrides:
clone in class Object

toString

public String toString()
Overrides:
toString in class Object

getBytes

public byte[] getBytes()
Specified by:
getBytes in class org.apache.hadoop.io.BinaryComparable

getLength

public int getLength()
Specified by:
getLength in class org.apache.hadoop.io.BinaryComparable


Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.