Created
December 4, 2015 04:39
-
-
Save malaikannan/cc16962d593d44b82dae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.DataInput; | |
import java.io.DataOutput; | |
import java.io.IOException; | |
import java.io.Serializable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.io.WritableComparable; | |
public class ColorWritable implements WritableComparable<ColorWritable>, | |
Serializable { | |
private Text color; | |
public ColorWritable() { | |
this.color = new Text(); | |
} | |
public ColorWritable(Text color) { | |
this.color = color; | |
} | |
public Text getColor() { | |
return color; | |
} | |
public void write(DataOutput out) throws IOException { | |
color.write(out); | |
} | |
public void readFields(DataInput in) throws IOException { | |
color.readFields(in); | |
} | |
public int compareTo(ColorWritable arg0) { | |
return 0; | |
} | |
@Override | |
public int hashCode() { | |
return super.hashCode(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment