![]() |
Bridges-Java 3.5.0
Bridges(Java API)
|
This is a class in BRIDGES for representing an (m x n) grid. More...
Public Member Functions | |
| String | getDataStructType () |
| Grid () | |
| Grid (int size) | |
| Grid (int rows, int cols) | |
| Construct a rows x cols size grid. More... | |
| Grid (int[] size) | |
| Construct a size[0] by size[1] sized grid. More... | |
| void | resize (int rows, int cols) |
| int[] | getDimensions () |
| Get the grid dimensions. More... | |
| E | get (Integer row, Integer col) |
| Get the (row, col) element in the grid. More... | |
| void | set (Integer row, Integer col, E val) |
| String | getDataStructureRepresentation () |
| Get data structure representation. More... | |
| abstract String | getDataStructType () |
| abstract String | getDataStructureRepresentation () |
Protected Attributes | |
| ArrayList< ArrayList< E > > | grid |
| int[] | gridSize |
Protected Attributes inherited from bridges.base.DataStruct | |
| String | QUOTE = "\"" |
| String | COMMA = "," |
| String | COLON = ":" |
| String | OPEN_CURLY = "{" |
| String | CLOSE_CURLY = "}" |
| String | OPEN_PAREN = "(" |
| String | CLOSE_PAREN = ")" |
| String | OPEN_BOX = "[" |
| String | CLOSE_BOX = "]" |
Static Protected Attributes | |
| static final int[] | defaultGridSize = {10, 10} |
| static int[] | maxGridSize = {1080, 1920} |
This is a class in BRIDGES for representing an (m x n) grid.
| bridges.base.Grid< E >.Grid | ( | ) |
Construct a grid with default sizes
| bridges.base.Grid< E >.Grid | ( | int | size | ) |
Construct a size x size grid
| bridges.base.Grid< E >.Grid | ( | int | rows, |
| int | cols | ||
| ) |
Construct a rows x cols size grid.
| rows | number of rows in grid |
| cols | number of rows in grid |
| bridges.base.Grid< E >.Grid | ( | int[] | size | ) |
Construct a size[0] by size[1] sized grid.
| size[] | specifies rows and column sizes of the grid |
| E bridges.base.Grid< E >.get | ( | Integer | row, |
| Integer | col | ||
| ) |
Get the (row, col) element in the grid.
| row | row index |
| col | column index |
| String bridges.base.Grid< E >.getDataStructType | ( | ) |
| String bridges.base.Grid< E >.getDataStructureRepresentation | ( | ) |
Get data structure representation.
Reimplemented from bridges.base.DataStruct.
| int[] bridges.base.Grid< E >.getDimensions | ( | ) |
Get the grid dimensions.
| void bridges.base.Grid< E >.resize | ( | int | rows, |
| int | cols | ||
| ) |
| void bridges.base.Grid< E >.set | ( | Integer | row, |
| Integer | col, | ||
| E | val | ||
| ) |
Set the (row, col) element in the grid
| row,col | cell to change |
| val | the value to be set to |
|
staticprotected |
|
protected |
|
protected |
|
staticprotected |