|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodel.Cell
public class Cell
ADT Cell which depicts a square, one of the 64 in a chessboard.
| Constructor Summary | |
|---|---|
Cell(int x,
int y)
constructor: Creates a new Cell with the given coordinates. |
|
Cell(int x,
int y,
java.awt.Color z,
Piece r)
constructor: Creates a new Cell with the given coordinates, the given color, and places a Piece on that Cell. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object other)
accessor(observer): Checks if two cells are equals, if they correspond to the same coordinates. |
java.awt.Color |
getColor()
accessor(selector): Returns the Color of a Cell. |
Piece |
getPiece()
accessor(selector): Returns the Piece from the specific Cell. |
int |
getX()
accessor(selector): Returns the Cell's ordinate. |
int |
getY()
accessor(selector): Returns the Cell's abscissa. |
int |
hashCode()
accessor(selector): Returns the hash code of the given Cell. |
void |
setColor(java.awt.Color z)
transformer(mutative): Sets the Cell's Color to the parameter passed by. |
void |
setPiece(Piece x)
transformer(mutative): Changes the Cell's Piece to the one passed as parameter. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Cell(int x,
int y)
throws IllegalCellException
x - The ordinate of the new Celly - The abscissa of the new Cell
java.lang.IllegalArgumentException - if x or y are invalid coordinates
IllegalCellException
public Cell(int x,
int y,
java.awt.Color z,
Piece r)
throws IllegalCellException
x - Ordinate of the new Celly - Abscissa of the new Cellz - Color of the new Cellr - Piece placed on the new Cell
java.lang.IllegalArgumentException - if x or y are not valid coordinates
IllegalCellException| Method Detail |
|---|
public java.awt.Color getColor()
public void setColor(java.awt.Color z)
z - Color to change the Cell.public Piece getPiece()
public void setPiece(Piece x)
x - Piece to be placed on the Cellpublic int getX()
public int getY()
public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - Other Cell to check equality
public int hashCode()
hashCode in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||