nz.ac.waikato.mcennis.rat.util
Class Duples<L,R>

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.util.Duples<L,R>
All Implemented Interfaces:
java.lang.Comparable

public class Duples<L,R>
extends java.lang.Object
implements java.lang.Comparable

Class for ordering pairs of objects so that they stay associated with each other after sorting.


Constructor Summary
Duples()
           
Duples(L l, R r)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Returns -1 if class L is not comparable, otherwise returns the output of left.compareTo(o.left)
 L getLeft()
          get left object in the duple
 R getRight()
          get right object in the duple
 void setLeft(L l)
          set the left object with this object
 void setRight(R r)
          set the right object with this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Duples

public Duples()

Duples

public Duples(L l,
              R r)
Method Detail

compareTo

public int compareTo(java.lang.Object o)
Returns -1 if class L is not comparable, otherwise returns the output of left.compareTo(o.left)

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - Duples to be compared to
Returns:

getLeft

public L getLeft()
get left object in the duple

Returns:
left item

getRight

public R getRight()
get right object in the duple

Returns:
right object

setLeft

public void setLeft(L l)
set the left object with this object

Parameters:
l - object to be set

setRight

public void setRight(R r)
set the right object with this object

Parameters:
r - object to be set