|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgame.PieceLocation
PieceLocation represents a Piece in a particular square on a particular board. PieceLocations are immutable.
Note that a PieceLocation object might be historical or hypothetical; it doesn't have to describe the piece's true current location. So board.getPieceAt(row,col) does not necessarily return piece.
Constructor Summary | |
PieceLocation(Board board,
Piece piece,
int row,
int col)
Make a PieceLocation. |
Method Summary | |
boolean |
equals(Object obj)
Test whether another object is equal to this, by observational equality. |
Board |
getBoard()
Get the board referenced by this piece location. |
int |
getColumn()
Get the column referenced by this piece location. |
Piece |
getPiece()
Get the piece referenced by this piece location. |
int |
getRow()
Get the row referenced by this piece location. |
int |
hashCode()
Get a hash code for this object. |
String |
toString()
|
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PieceLocation(Board board, Piece piece, int row, int col)
board
- board containing piece (not null)piece
- piece in board (not null)row
- row number in the range [0,board.size-1]col
- column number in the range [0,board.size-1]Method Detail |
public Board getBoard()
public Piece getPiece()
public int getRow()
public int getColumn()
public boolean equals(Object obj)
public int hashCode()
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |