java.lang.Object
org.joda.collect.grid.ImmutableCell<V>
- Type Parameters:
V
- the type of the value
- All Implemented Interfaces:
Serializable
,Grid.Cell<V>
Immutable implementations of the
Grid.Cell
data structure.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R> ImmutableCell
<R> Obtains an instance ofCell
.boolean
equalRowColumn
(int row, int column) Checks if the row-column of this cell matches the specified row and column.boolean
Checks if this cell equals another cell.boolean
equalValue
(Object value) Checks if the value of this cell matches the specified value.int
Gets the column index.int
getRow()
Gets the row index.getValue()
Gets the value of the cell.int
hashCode()
Gets a suitable hash code.static <R> ImmutableCell
<R> of
(int row, int column, R value) Obtains an instance ofCell
.toString()
-
Method Details
-
of
Obtains an instance ofCell
.- Type Parameters:
R
- the type of the value- Parameters:
row
- the row, zero or greatercolumn
- the column, zero or greatervalue
- the value to put into the grid, not null- Returns:
- the immutable cell, not null
- Throws:
IndexOutOfBoundsException
- if either index is less than zero
-
copyOf
Obtains an instance ofCell
.- Type Parameters:
R
- the type of the value- Parameters:
cell
- the cell to copy, not null- Returns:
- the immutable cell, not null
-
getRow
public int getRow()Description copied from interface:Grid.Cell
Gets the row index. -
getColumn
public int getColumn()Description copied from interface:Grid.Cell
Gets the column index. -
getValue
Description copied from interface:Grid.Cell
Gets the value of the cell. -
equalRowColumn
public boolean equalRowColumn(int row, int column) Description copied from interface:Grid.Cell
Checks if the row-column of this cell matches the specified row and column.- Specified by:
equalRowColumn
in interfaceGrid.Cell<V>
- Parameters:
row
- the row to checkcolumn
- the column to check- Returns:
- true if equal
-
equalValue
Description copied from interface:Grid.Cell
Checks if the value of this cell matches the specified value.- Specified by:
equalValue
in interfaceGrid.Cell<V>
- Parameters:
value
- the row to check, null returns false- Returns:
- true if equal
-
equals
Description copied from interface:Grid.Cell
Checks if this cell equals another cell.Two cells are equal if they have equal row, column and value.
-
hashCode
public int hashCode()Description copied from interface:Grid.Cell
Gets a suitable hash code.The hash code is
row ^ Integer.rotateLeft(column, 16) ^ value.hashCode()
. -
toString
-