edu.utah.further.core.math.misc
Class ComparablePair<A extends Comparable<A>,B extends Comparable<B>>

java.lang.Object
  extended by edu.utah.further.core.math.misc.Pair<A,B>
      extended by edu.utah.further.core.math.misc.ComparablePair<A,B>
All Implemented Interfaces:
Comparable<ComparablePair<A,B>>
Direct Known Subclasses:
IntegerPair, StringPair

@Api
public class ComparablePair<A extends Comparable<A>,B extends Comparable<B>>
extends Pair<A,B>
implements Comparable<ComparablePair<A,B>>

A pair of comparable objects.

-----------------------------------------------------------------------------------
(c) 2008-2011 FURTHeR Project, Health Sciences IT, University of Utah
Contact: Dr. Scott Narus <scott.narus@hsc.utah.edu>
Biomedical Informatics, 26 South 2000 East
Room 5775 HSEB, Salt Lake City, UT 84112
Day Phone: 1-801-213-3288
-----------------------------------------------------------------------------------

Version:
May 29, 2009
Author:
Oren E. Livne <oren.livne@utah.edu>

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.utah.further.core.math.misc.Pair
Pair.Element
 
Field Summary
 
Fields inherited from class edu.utah.further.core.math.misc.Pair
left, right
 
Constructor Summary
ComparablePair(A left, B right)
           
 
Method Summary
 int compareTo(ComparablePair<A,B> other)
          Compare two pairs by lexicographic order (first in, left, then in right).
 
Methods inherited from class edu.utah.further.core.math.misc.Pair
equals, getLeft, getRight, hashCode, set, setLeft, setRight, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComparablePair

public ComparablePair(A left,
                      B right)
Parameters:
left -
right -
Method Detail

compareTo

public final int compareTo(ComparablePair<A,B> other)
Compare two pairs by lexicographic order (first in, left, then in right). Compatible with the equals() method if and only if the compareTo() method in types A and B are Compatible with the corresponding equals() methods therein.

Specified by:
compareTo in interface Comparable<ComparablePair<A extends Comparable<A>,B extends Comparable<B>>>
Parameters:
other - the other Pair to be compared with this one.
Returns:
the result of comparison


Copyright © 2011 Office of the AVP for Health Sci. IT. All Rights Reserved.