|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jeops.examples.queens.Queen
Represents a queen in a chess board.
Field Summary | |
private int |
column
The column of the board (1-8). |
private int |
row
The row of the board (1-8). |
Constructor Summary | |
Queen(int row,
int column)
Class constructor. |
Method Summary | |
boolean |
attacks(Queen q)
Checks whether this queen can be attacked by the given one. |
void |
dump()
Prints this queen. |
void |
dump(int spaces)
Prints this queen with the specified identation. |
int |
getColumn()
Returns the column of this queen. |
int |
getRow()
Returns the row of this queen. |
java.lang.String |
toString()
Returns a string representation of this queen. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private int row
private int column
Constructor Detail |
public Queen(int row, int column)
row
- the row of the board.column
- the column of the board.Method Detail |
public int getRow()
public int getColumn()
public boolean attacks(Queen q)
the
- queen that tries to attack this onetrue
if this queen can be attacked by the
given one; false
otherwise.public void dump()
public void dump(int spaces)
spaces
- the desired identationpublic java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |