poker.util
Class NChoose2IntTable

java.lang.Object
  extended by poker.util.NChoose2IntTable

public class NChoose2IntTable
extends java.lang.Object

Keeps an NChoose2 table of integers.

Author:
Aaron Davidson

Constructor Summary
NChoose2IntTable(int n)
           
 
Method Summary
 int get(int x, int y)
          Obtain the value linking elements x and y
 int getValue(int index)
          Get the value at the given index.
 int[] getValues()
           
 void initTable(int val)
          initialize all entries in the table to val.
 int length()
          The total number of entries in the table.
 void set(int x, int y, int val)
          Set the value linking elements x and y
 void setValue(int index, int val)
          set the value at index to value
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NChoose2IntTable

public NChoose2IntTable(int n)
Method Detail

initTable

public void initTable(int val)
initialize all entries in the table to val.


getValue

public final int getValue(int index)
Get the value at the given index.


setValue

public void setValue(int index,
                     int val)
set the value at index to value


length

public final int length()
The total number of entries in the table.


get

public final int get(int x,
                     int y)
Obtain the value linking elements x and y

Parameters:
x - the first element
y - the second element
Returns:
the value of x,y

set

public final void set(int x,
                      int y,
                      int val)
Set the value linking elements x and y

Parameters:
x - the first element
y - the second element
val - the value of x,y

getValues

public int[] getValues()