il2.util
Class UPair

Object
  extended by UPair

public final class UPair
extends Object

A sorted pair of ints.

This class conforms to the immutable design pattern.

Author:
James Park, Mark Chavira

Field Summary
 int s1
          The smaller int.
 int s2
          The larger int.
 
Constructor Summary
UPair(Integer i1, Integer i2)
          Initializes the upair; sorts the ints before storing them.
UPair(int i1, int i2)
          Initializes the upair; sorts the ints before storing them.
UPair(Pair p)
          Initializes the upair from another upair.
 
Method Summary
 boolean equals(Object obj)
          Fulfills java.lang.Object.
 int hashCode()
          Fulfills java.lang.Object.
 
Methods inherited from class Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s1

public final int s1
The smaller int.


s2

public final int s2
The larger int.

Constructor Detail

UPair

public UPair(Pair p)
Initializes the upair from another upair.

Parameters:
p - the other upair.

UPair

public UPair(Integer i1,
             Integer i2)
Initializes the upair; sorts the ints before storing them.

Parameters:
i1 - one of the ints.
i2 - the other int.

UPair

public UPair(int i1,
             int i2)
Initializes the upair; sorts the ints before storing them.

Parameters:
i1 - one of the ints.
i2 - the other int.
Method Detail

equals

public boolean equals(Object obj)
Fulfills java.lang.Object.

Overrides:
equals in class Object

hashCode

public int hashCode()
Fulfills java.lang.Object.

Overrides:
hashCode in class Object


Copyright 2010 UCLA Automated Reasoning Group