edu.illinois.cs.cogcomp.lbj.coref.util.aux
Class CompPair<A extends java.lang.Comparable<A>,B extends java.lang.Comparable<B>>

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.util.aux.Pair<A,B>
      extended by edu.illinois.cs.cogcomp.lbj.coref.util.aux.CompPair<A,B>
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<CompPair<A,B>>

public class CompPair<A extends java.lang.Comparable<A>,B extends java.lang.Comparable<B>>
extends Pair<A,B>
implements java.lang.Comparable<CompPair<A,B>>

Although Pair implements Comparable, it is only comparable if A and B implement Comparable -- if they do not, in the future, Exceptions may be thrown.

See Also:
Serialized Form

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class edu.illinois.cs.cogcomp.lbj.coref.util.aux.Pair
a, b
 
Constructor Summary
CompPair()
           
CompPair(A _a, B _b)
           
 
Method Summary
 int compareTo(CompPair<A,B> pair)
          Comparison function for ascending order sorts, sorting first by a and then by b, using A's and B's compareTo functions.
static
<S extends java.lang.Comparable<S>,T extends java.lang.Comparable<T>>
CompPair<S,T>
create(S s, T t)
           
 
Methods inherited from class edu.illinois.cs.cogcomp.lbj.coref.util.aux.Pair
equals, getFirst, getSecond, hashCode, setFirst, setSecond, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

CompPair

public CompPair()

CompPair

public CompPair(A _a,
                B _b)
Method Detail

create

public static <S extends java.lang.Comparable<S>,T extends java.lang.Comparable<T>> CompPair<S,T> create(S s,
                                                                                                         T t)

compareTo

public int compareTo(CompPair<A,B> pair)
Comparison function for ascending order sorts, sorting first by a and then by b, using A's and B's compareTo functions. Consistent with equals only when A and B's compareTo methods are consistent with their equals methods.

Specified by:
compareTo in interface java.lang.Comparable<CompPair<A extends java.lang.Comparable<A>,B extends java.lang.Comparable<B>>>