public class SquareGrid
extends java.lang.Object
SquareNode as a grid. Must be a complete grid with no
missing elements. CW or CCW orientation is not specified.| Modifier and Type | Field and Description |
|---|---|
int |
columns |
java.util.List<SquareNode> |
nodes |
int |
rows |
| Constructor and Description |
|---|
SquareGrid() |
| Modifier and Type | Method and Description |
|---|---|
SquareNode |
get(int row,
int col)
Looks up the node based on its coordinate.
|
SquareNode |
getCornerByIndex(int index)
Returns the corner specified by its index.
|
int |
getCornerIndex(SquareNode node)
Returns the index of the corner.
|
int |
indexOf(int row,
int col) |
void |
reset() |
void |
set(int row,
int col,
SquareNode node) |
public java.util.List<SquareNode> nodes
public int columns
public int rows
public void reset()
public SquareNode get(int row, int col)
public void set(int row,
int col,
SquareNode node)
public int indexOf(int row,
int col)
public SquareNode getCornerByIndex(int index)
index - 0 to 3, inclusivepublic int getCornerIndex(SquareNode node)