|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.columbia.cs.cs1007.checkers.Square
public class Square
This class implements a square of the checkers board. It contains both the color of the square, and any pieces that may have been placed onto that square.
| Constructor Summary | |
|---|---|
Square(Constants.SQUARE_COLOR color)
Constructor that creates a square with an "empty" piece. |
|
Square(Constants.SQUARE_COLOR color,
Piece contents)
Constructor. |
|
| Method Summary | |
|---|---|
Constants.SQUARE_COLOR |
getColor()
Accessor. |
Piece |
getContents()
Accessor. |
boolean |
isOccupied()
Check whether there is a non-empty piece on this square. |
void |
removeContents()
Replace the contents of the square by an "empty" piece. |
void |
setContents(Piece contents)
Place a piece onto the square. |
java.lang.String |
toString()
Generate a string representation of the square. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Square(Constants.SQUARE_COLOR color)
color -
public Square(Constants.SQUARE_COLOR color,
Piece contents)
color - contents - | Method Detail |
|---|
public Constants.SQUARE_COLOR getColor()
public Piece getContents()
public void setContents(Piece contents)
contents - public void removeContents()
public boolean isOccupied()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||