org.apache.gora.tutorial.log
Class KeyValueWritable<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.WritableComparable>

java.lang.Object
  extended by org.apache.gora.tutorial.log.KeyValueWritable<K,V>
Type Parameters:
K - the class of key
V - the class of value
All Implemented Interfaces:
Comparable<KeyValueWritable<K,V>>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<KeyValueWritable<K,V>>
Direct Known Subclasses:
TextLong

public class KeyValueWritable<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.WritableComparable>
extends Object
implements org.apache.hadoop.io.WritableComparable<KeyValueWritable<K,V>>

A WritableComparable containing a key-value WritableComparable pair.


Field Summary
protected  K key
           
protected  V value
           
 
Constructor Summary
KeyValueWritable()
           
KeyValueWritable(K key, V value)
           
 
Method Summary
 int compareTo(KeyValueWritable<K,V> o)
           
 boolean equals(Object obj)
           
 K getKey()
           
 V getValue()
           
 int hashCode()
           
 void readFields(DataInput in)
           
 void setKey(K key)
           
 void setValue(V value)
           
 void write(DataOutput out)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

protected K extends org.apache.hadoop.io.WritableComparable key

value

protected V extends org.apache.hadoop.io.WritableComparable value
Constructor Detail

KeyValueWritable

public KeyValueWritable()

KeyValueWritable

public KeyValueWritable(K key,
                        V value)
Method Detail

getKey

public K getKey()

setKey

public void setKey(K key)

getValue

public V getValue()

setValue

public void setValue(V value)

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 Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

compareTo

public int compareTo(KeyValueWritable<K,V> o)
Specified by:
compareTo in interface Comparable<KeyValueWritable<K extends org.apache.hadoop.io.WritableComparable,V extends org.apache.hadoop.io.WritableComparable>>


Copyright © 2010-2013 The Apache Software Foundation. All Rights Reserved.