| Constructor and Description |
|---|
Grid(int width,
int height) |
| Modifier and Type | Method and Description |
|---|---|
void |
dump(java.lang.String format,
java.lang.String field) |
void |
forEachTwoCells(EachTwoCellsCallback eachTwoCellsCallback) |
Cell |
getCell(int index) |
Cell |
getCell(int x,
int y) |
int |
getHeight() |
int |
getLength() |
int |
getWidth() |
java.util.Iterator<Cell> |
iterator() |
void |
read(java.io.File file) |
void |
read(java.io.File file,
java.lang.String fieldName) |
void |
swap(Cell cell1,
Cell cell2) |
void |
write(java.io.File file) |
void |
write(java.io.File file,
java.lang.String fieldName) |
public Cell getCell(int index)
public Cell getCell(int x, int y)
public int getWidth()
public int getHeight()
public int getLength()
public void swap(Cell cell1, Cell cell2)
cell1 - The first cell to swapcell2 - The second cell to swappublic void forEachTwoCells(EachTwoCellsCallback eachTwoCellsCallback)
public java.util.Iterator<Cell> iterator()
iterator in interface java.lang.Iterable<Cell>public void read(java.io.File file,
java.lang.String fieldName)
throws java.io.IOException
java.io.IOExceptionpublic void read(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic void write(java.io.File file,
java.lang.String fieldName)
throws java.io.IOException
java.io.IOExceptionpublic void write(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic void dump(java.lang.String format,
java.lang.String field)