edu.umd.cloud9.io.triple
Class TripleOfIntsDouble

java.lang.Object
  extended by edu.umd.cloud9.io.triple.TripleOfIntsDouble
All Implemented Interfaces:
Comparable<TripleOfIntsDouble>, Writable, WritableComparable<TripleOfIntsDouble>

public class TripleOfIntsDouble
extends Object
implements WritableComparable<TripleOfIntsDouble>

Author:
Ke Zhai

Nested Class Summary
static class TripleOfIntsDouble.Comparator
          Comparator optimized for TripleOfInts.
 
Constructor Summary
TripleOfIntsDouble()
          Creates a TripleOnInts object.
TripleOfIntsDouble(int left, int middle, double right)
          Creates a TripleOnInts object.
 
Method Summary
 TripleOfIntsDouble clone()
          Clones this object.
 int compareTo(TripleOfIntsDouble obj)
          Defines a natural sort order for pairs.
 boolean equals(Object obj)
          Checks for equality.
 int getLeftElement()
          Returns the left element.
 int getMiddleElement()
          Returns the middle element.
 double getRightElement()
          Returns the right element.
 int hashCode()
          Returns a hash code value for this ThreeInts instance.
 void readFields(DataInput in)
          Deserializes this object.
 void set(int left, int middle, double right)
          Sets the elements of this triple.
 String toString()
          Generates human-readable String representation of this pair.
 void write(DataOutput out)
          Serializes this object.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TripleOfIntsDouble

public TripleOfIntsDouble()
Creates a TripleOnInts object.


TripleOfIntsDouble

public TripleOfIntsDouble(int left,
                          int middle,
                          double right)
Creates a TripleOnInts object.

Parameters:
left - the left element
middle - the middle element
right - the right element
Method Detail

readFields

public void readFields(DataInput in)
                throws IOException
Deserializes this object.

Specified by:
readFields in interface Writable
Parameters:
in - source for raw byte representation
Throws:
IOException

write

public void write(DataOutput out)
           throws IOException
Serializes this object.

Specified by:
write in interface Writable
Parameters:
out - where to write the raw byte representation
Throws:
IOException

getLeftElement

public int getLeftElement()
Returns the left element.

Returns:
the left element

getMiddleElement

public int getMiddleElement()
Returns the middle element.

Returns:
the middle element

getRightElement

public double getRightElement()
Returns the right element.

Returns:
the right element

set

public void set(int left,
                int middle,
                double right)
Sets the elements of this triple.

Parameters:
left - the left element
middle - the middle element
right - the right element

equals

public boolean equals(Object obj)
Checks for equality.

Overrides:
equals in class Object
Parameters:
obj - object for comparison
Returns:
true if obj is equal to this object, false otherwise

compareTo

public int compareTo(TripleOfIntsDouble obj)
Defines a natural sort order for pairs. Pairs are sorted first by the left element, and then by the right element.

Specified by:
compareTo in interface Comparable<TripleOfIntsDouble>
Returns:
a value less than zero, a value greater than zero, or zero if this pair should be sorted before, sorted after, or is equal to obj.

hashCode

public int hashCode()
Returns a hash code value for this ThreeInts instance.

Overrides:
hashCode in class Object
Returns:
hash code for this ThreeInts instance

toString

public String toString()
Generates human-readable String representation of this pair.

Overrides:
toString in class Object
Returns:
human-readable String representation of this pair

clone

public TripleOfIntsDouble clone()
Clones this object.

Overrides:
clone in class Object
Returns:
clone of this object