V - the type of the valuejava.io.Serializable, Grid.Cell<V>public final class ImmutableCell<V>
extends java.lang.Object
implements java.io.Serializable
Grid.Cell data structure.| Modifier and Type | Method | Description |
|---|---|---|
static <R> ImmutableCell<R> |
copyOf(Grid.Cell<? extends R> cell) |
Obtains an instance of
Cell. |
boolean |
equalRowColumn(int row,
int column) |
Checks if the row-column of this cell matches the specified row and column.
|
boolean |
equals(java.lang.Object obj) |
Checks if this cell equals another cell.
|
boolean |
equalValue(java.lang.Object value) |
Checks if the value of this cell matches the specified value.
|
int |
getColumn() |
Gets the column index.
|
int |
getRow() |
Gets the row index.
|
V |
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 of
Cell. |
java.lang.String |
toString() |
public static <R> ImmutableCell<R> of(int row, int column, R value)
Cell.R - the type of the valuerow - the row, zero or greatercolumn - the column, zero or greatervalue - the value to put into the grid, not nulljava.lang.IndexOutOfBoundsException - if either index is less than zeropublic static <R> ImmutableCell<R> copyOf(Grid.Cell<? extends R> cell)
Cell.R - the type of the valuecell - the cell to copy, not nullpublic int getRow()
Grid.Cellpublic int getColumn()
Grid.Cellpublic V getValue()
Grid.Cellpublic boolean equalRowColumn(int row,
int column)
Grid.CellequalRowColumn in interface Grid.Cell<V>row - the row to checkcolumn - the column to checkpublic boolean equalValue(java.lang.Object value)
Grid.CellequalValue in interface Grid.Cell<V>value - the row to check, null returns falsepublic boolean equals(java.lang.Object obj)
Grid.CellTwo cells are equal if they have equal row, column and value.
public int hashCode()
Grid.Cell
The hash code is row ^ Integer.rotateLeft(column, 16) ^ value.hashCode().
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2017 Joda.org. All rights reserved.