soc.util
Class IntPair

java.lang.Object
  extended by soc.util.IntPair

public class IntPair
extends java.lang.Object

An ordered pair of 2 ints.

See Also:
IntTriple

Field Summary
 int a
          The first int of the ordered pair
 int b
          The second int of the ordered pair
 
Constructor Summary
IntPair(int a, int b)
          Creates a new IntPair object.
 
Method Summary
 boolean equals(IntPair ip)
          Are these IntPairs' integers equal (unordered comparison)?
 int getA()
          Get the first int of this pair.
 int getB()
          Get the second int of this pair.
 void setA(int val)
          Set the first int of this pair.
 void setB(int val)
          Set the second int of this pair.
 java.lang.String toString()
          Get a string with the hex contents of this pair.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

a

public int a
The first int of the ordered pair


b

public int b
The second int of the ordered pair

Constructor Detail

IntPair

public IntPair(int a,
               int b)
Creates a new IntPair object.

Parameters:
a - First int
b - Second int
Method Detail

equals

public boolean equals(IntPair ip)
Are these IntPairs' integers equal (unordered comparison)?

Parameters:
ip - Another IntPair
Returns:
True if pairs' contents are (I,J) and (I,J), or (I,J) and (J,I)

getA

public int getA()
Get the first int of this pair.

Returns:
Current value of a

getB

public int getB()
Get the second int of this pair.

Returns:
Current value of b

setA

public void setA(int val)
Set the first int of this pair.

Parameters:
val - New value for a

setB

public void setB(int val)
Set the second int of this pair.

Parameters:
val - New value for b

toString

public java.lang.String toString()
Get a string with the hex contents of this pair.

Overrides:
toString in class java.lang.Object
Returns:
A string of format "a:##, b:##", where ## are the values in hexadecimal