|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectBoard
public class Board
Represents a 4 X 13 board of cards. The cards can be either face up or face down. Cards can also be removed from the board. Bugs: none known
Constructor Summary | |
---|---|
Board()
Constructs a Board object. |
Method Summary | |
---|---|
GameCard |
getCard(int row,
int col)
Returns the card at the given row and column. |
boolean |
invalidBoardPosition(int row,
int col)
Returns true if and only if (row, col) is not a valid position on the board. |
boolean |
isEmpty()
Returns true if there are no more cards on the board. |
boolean |
removeCard(GameCard card)
Removes the given card from the board. |
boolean |
removeCard(int row,
int col)
Removes the card at the given row and column. |
java.lang.String |
toString()
Returns a string representation of the board suitable for printing with System.out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Board()
Method Detail |
---|
public GameCard getCard(int row, int col)
row
- the row index (starting at 0)col
- the column index (starting at 0)
public boolean removeCard(int row, int col)
row
- the row index (starting at 0)col
- the column index (starting at 0)
public boolean removeCard(GameCard card)
card
- the card to remove from the board
public boolean isEmpty()
public boolean invalidBoardPosition(int row, int col)
row
- the row index (starting at 0)col
- the column index (starting at 0)
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 |