public class Pair
- Object
- Pair
ImplementsComparable<Pair>
Java note: at the “creation” of each node, a random key is given to that node, and that’s what we
sort from.
Fields
public int proxyIdA | |
public int proxyIdB |
Constructors
public Pair() |
Methods
public int compareTo(Pair pair2) | Compares this object to the specified object to determine their relative order. |
Inherited methods
Field details
proxyIdA
public int proxyIdAproxyIdB
public int proxyIdBConstructor details
Pair
public Pair()Method details
compareTo
public int compareTo(Pair pair2)Compares this object to the specified object to determine their relative
order.
Parameters
pair2Pair- the object to compare to this instance.
Returns
a negative integer if this instance is less than
another;
a positive integer if this instance is greater than
another; 0 if this instance has the same order as
another.Throws
ClassCastException- if
anothercannot be converted into something comparable tothisinstance.