gov.llnl.ontology.util
Class StringPair

java.lang.Object
  extended by gov.llnl.ontology.util.StringPair
All Implemented Interfaces:
Comparable, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable

public class StringPair
extends Object
implements Comparable, org.apache.hadoop.io.WritableComparable

A pair of Strings that can be used as a key in map reduce jobs.

Author:
Keith Stevens

Field Summary
 String x
           
 String y
           
 
Constructor Summary
StringPair()
          Constructs an empty StringPair for use with the WritableComparable interface.
StringPair(String x, String y)
          Constructs a new StringPair.
 
Method Summary
 int compareTo(Object o)
          Compares this StringPair to another StringPair.
 int compareTo(StringPair w)
          
 boolean equals(Object o)
          
static StringPair fromString(String text)
          Returns a new StringPair from the contents of a string that has been printed via toString().
 int hashCode()
          
 void readFields(DataInput in)
          
 String toString()
          
 void write(DataOutput out)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

x

public String x

y

public String y
Constructor Detail

StringPair

public StringPair()
Constructs an empty StringPair for use with the WritableComparable interface.


StringPair

public StringPair(String x,
                  String y)
Constructs a new StringPair.

Method Detail

compareTo

public int compareTo(Object o)
Compares this StringPair to another StringPair. Ordering is based first on the x value and then the y if there is a tie.

Specified by:
compareTo in interface Comparable

write

public void write(DataOutput out)
           throws IOException

Specified by:
write in interface org.apache.hadoop.io.Writable
Throws:
IOException

readFields

public void readFields(DataInput in)
                throws IOException

Specified by:
readFields in interface org.apache.hadoop.io.Writable
Throws:
IOException

compareTo

public int compareTo(StringPair w)


equals

public boolean equals(Object o)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

fromString

public static StringPair fromString(String text)
Returns a new StringPair from the contents of a string that has been printed via toString().


toString

public String toString()

Overrides:
toString in class Object


Copyright © 2010-2011. All Rights Reserved.