jopt.js.api.util
Class DoubleIndexedIntList

java.lang.Object
  extended byjopt.js.api.util.DoubleIndexedIntList

public class DoubleIndexedIntList
extends java.lang.Object

A data structure that can grow dynamically in two dimensions.

Author:
James Boerkoel

Constructor Summary
DoubleIndexedIntList()
           
 
Method Summary
 int add(int index2, int element)
          Adds element at index2 in the second index
 int get(int index1, int index2)
          Gets the element at index index1,index2
 void set(int index1, int index2, int element)
          Sets the element at index1,index2, to element
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleIndexedIntList

public DoubleIndexedIntList()
Method Detail

add

public int add(int index2,
               int element)
Adds element at index2 in the second index

Parameters:
index2 - - the second index
element - - the element being added
Returns:
the first index where this is placed

get

public int get(int index1,
               int index2)
Gets the element at index index1,index2

Parameters:
index1 - - first index
index2 - - second index
Returns:
element at given indices

set

public void set(int index1,
                int index2,
                int element)
Sets the element at index1,index2, to element

Parameters:
index1 - - first index
index2 - - second index
element - - new element being set