Class Pair<X extends Comparable<X>,Y extends Comparable<Y>>

java.lang.Object
picard.sam.util.Pair<X,Y>
All Implemented Interfaces:
Comparable<Pair<X,Y>>

public class Pair<X extends Comparable<X>,Y extends Comparable<Y>> extends Object implements Comparable<Pair<X,Y>>
Simple Pair class. reimplemented since the commons one is final, and I wanted a different toString function...
  • Constructor Details

    • Pair

      public Pair(X left, Y right)
  • Method Details

    • getLeft

      public X getLeft()
    • getRight

      public Y getRight()
    • equals

      public boolean equals(Object o)
      Calculate whether this pair object is equal to another object.
      Overrides:
      equals in class Object
      Parameters:
      o - The other object (hopefully a pair).
      Returns:
      True if the two are equal; false otherwise.
    • hashCode

      public int hashCode()
      Basic hashcode function. Assume hashcodes of left and right are randomly distributed and return the XOR of the two.
      Overrides:
      hashCode in class Object
      Returns:
      hashcode of the pair.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • compareTo

      public int compareTo(Pair<X,Y> o)
      Specified by:
      compareTo in interface Comparable<X extends Comparable<X>>