org.apache.mahout.cf.taste.hadoop.cooccurence
Class Bigram
java.lang.Object
org.apache.mahout.cf.taste.hadoop.cooccurence.Bigram
- All Implemented Interfaces:
- java.lang.Comparable<Bigram>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<Bigram>
public final class Bigram
- extends java.lang.Object
- implements org.apache.hadoop.io.WritableComparable<Bigram>
Nested Class Summary |
static class |
Bigram.Comparator
A Comparator that compares serialized Bigrams. |
static class |
Bigram.FirstGroupingComparator
Compare only the first part of the bigram, so that reduce is called once for each value of the first
part. |
static class |
Bigram.Frequency
A wrapper class that associates pairs with frequency (Occurences) |
Method Summary |
int |
compareTo(Bigram o)
|
boolean |
equals(java.lang.Object right)
|
int |
getFirst()
|
int |
getSecond()
|
int |
hashCode()
|
void |
readFields(java.io.DataInput in)
Read the two integers encoded using variable length encoding |
void |
set(int first,
int second)
|
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
Write the two integers encoded using variable length encoding |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Bigram
public Bigram()
Bigram
public Bigram(Bigram bigram)
Bigram
public Bigram(int first,
int second)
set
public void set(int first,
int second)
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 using variable length encoding
- 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
- Write the two integers encoded using variable length encoding
- 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(Bigram o)
- Specified by:
compareTo
in interface java.lang.Comparable<Bigram>
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.