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.booleanequalRowColumn(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.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.CellGets the row index. -
getColumn
public int getColumn()Description copied from interface:Grid.CellGets the column index. -
getValue
Description copied from interface:Grid.CellGets the value of the cell. -
equalRowColumn
public boolean equalRowColumn(int row, int column) Description copied from interface:Grid.CellChecks if the row-column of this cell matches the specified row and column.- Specified by:
equalRowColumnin interfaceGrid.Cell<V>- Parameters:
row- the row to checkcolumn- the column to check- Returns:
- true if equal
-
equalValue
Description copied from interface:Grid.CellChecks if the value of this cell matches the specified value.- Specified by:
equalValuein interfaceGrid.Cell<V>- Parameters:
value- the row to check, null returns false- Returns:
- true if equal
-
equals
Description copied from interface:Grid.CellChecks 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.CellGets a suitable hash code.The hash code is
row ^ Integer.rotateLeft(column, 16) ^ value.hashCode(). -
toString
-