- Type Parameters:
V- the type of the value
- All Known Implementing Classes:
ImmutableCell
public static interface Grid.Cell<V>
A cell within the grid compared only using row and column.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanequalRowColumn(int row, int column) Checks if the row-column of this cell matches the specified row and column.booleanChecks if this cell equals another cell.booleanequalValue(Object value) Checks if the value of this cell matches the specified value.intGets the column index.intgetRow()Gets the row index.getValue()Gets the value of the cell.inthashCode()Gets a suitable hash code.
-
Method Details
-
getRow
int getRow()Gets the row index.- Returns:
- the row, zero or greater
-
getColumn
int getColumn()Gets the column index.- Returns:
- the column, zero or greater
-
getValue
V getValue()Gets the value of the cell.- Returns:
- the cell value, not null
-
equalRowColumn
boolean equalRowColumn(int row, int column) Checks if the row-column of this cell matches the specified row and column.- Parameters:
row- the row to checkcolumn- the column to check- Returns:
- true if equal
-
equalValue
Checks if the value of this cell matches the specified value.- Parameters:
value- the row to check, null returns false- Returns:
- true if equal
-
equals
Checks if this cell equals another cell.Two cells are equal if they have equal row, column and value.
-
hashCode
int hashCode()Gets a suitable hash code.The hash code is
row ^ Integer.rotateLeft(column, 16) ^ value.hashCode().
-