de.hpi.fgis.voidgen.hadoop.datatypes
Class StringArrayWritableComparable

java.lang.Object
  extended by de.hpi.fgis.voidgen.hadoop.datatypes.StringArrayWritableComparable
All Implemented Interfaces:
java.lang.Comparable<StringArrayWritableComparable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<StringArrayWritableComparable>

public class StringArrayWritableComparable
extends java.lang.Object
implements org.apache.hadoop.io.WritableComparable<StringArrayWritableComparable>

Encapsulates reading and writing String arrays in Hadoop sequence files.

Author:
Johannes Gosda, Hasso Plattner Institute at University of Potsdam, Germany

Field Summary
protected  java.lang.String[] values
          The String values.
 
Constructor Summary
StringArrayWritableComparable()
          Default Constructor.
StringArrayWritableComparable(int size)
          Constructor specifying the size of the array.
 
Method Summary
 int compareTo(StringArrayWritableComparable arg0)
           
 boolean equals(java.lang.Object obj)
           
 int hashCode()
           
 void readFields(java.io.DataInput arg0)
           
 void set(int index, java.lang.String value)
          Sets the value at the given index.
 java.lang.String toString()
           
 void write(java.io.DataOutput arg0)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

values

protected java.lang.String[] values
The String values.

Constructor Detail

StringArrayWritableComparable

public StringArrayWritableComparable()
Default Constructor.


StringArrayWritableComparable

public StringArrayWritableComparable(int size)
Constructor specifying the size of the array.

Parameters:
size - the size of the array.
Method Detail

readFields

public void readFields(java.io.DataInput arg0)
                throws java.io.IOException
Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

write

public void write(java.io.DataOutput arg0)
           throws java.io.IOException
Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
java.io.IOException

compareTo

public int compareTo(StringArrayWritableComparable arg0)
Specified by:
compareTo in interface java.lang.Comparable<StringArrayWritableComparable>

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

set

public void set(int index,
                java.lang.String value)
Sets the value at the given index.

Parameters:
index - The index of the value to set (overwrite).
value - The value to set.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is out of range

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object