public class Pair

  1. Object
  2. 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 proxyIdA

proxyIdB

public int proxyIdB

Constructor 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

pair2 Pair
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 another cannot be converted into something comparable to this instance.