|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.infinityloop.util.GridBase
public class GridBase
A helper object/container for a dynamically sized, two-dimensional grid storage container (table, two-dimensional array)
Field Summary | |
---|---|
protected java.util.Hashtable |
grid
|
Constructor Summary | |
---|---|
GridBase()
|
Method Summary | |
---|---|
java.lang.Object |
get(int x,
int y)
Get the object from cell (X,Y) |
int |
getDimensionX()
Gets the current max grid dimension in x direction. |
int |
getDimensionY()
Gets the current max grid dimension in y direction. |
java.util.Hashtable |
getGrid()
|
java.lang.Object |
remove(int x,
int y)
Removes any element at the specified position. |
java.lang.Object |
set(int x,
int y,
java.lang.Object obj)
Set an object into cell (X,Y) |
void |
setGrid(java.util.Hashtable grid)
|
java.lang.String |
toString()
Writes the grid to a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Hashtable grid
Constructor Detail |
---|
public GridBase()
Method Detail |
---|
public java.lang.Object set(int x, int y, java.lang.Object obj) throws java.lang.IndexOutOfBoundsException
x
- 0-based index first dimensiony
- 0-based index second dimensionobj
- Object to store at (x,y)
java.lang.IndexOutOfBoundsException
public java.lang.Object get(int x, int y) throws java.lang.IndexOutOfBoundsException
x
- 0-based index first dimensiony
- 0-based index second dimension
java.lang.IndexOutOfBoundsException
public int getDimensionX()
public int getDimensionY()
public java.lang.Object remove(int x, int y)
public java.util.Hashtable getGrid()
public void setGrid(java.util.Hashtable grid)
grid
- The grid to set.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |