|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectDeck
public class Deck
Represents a deck of cards. A deck starts with 52 cards. A deck may be shuffled (i.e. randomly mix up the order of the cards in the deck). The cards in a deck may be dealt one by one from the deck. Bugs: none known
| Field Summary | |
|---|---|
static int |
DECK_SIZE
|
| Constructor Summary | |
|---|---|
Deck()
Constructs a new Deck object containing 52 cards. |
|
| Method Summary | |
|---|---|
Card |
deal()
Deals one card from the deck, decreasing the number of cards in the deck by one. |
void |
reset()
Resets the deck so that it has all its cards. |
void |
shuffle()
Shuffles the deck (i.e. |
java.lang.String |
toString()
Returns a String representation of the Deck object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DECK_SIZE
| Constructor Detail |
|---|
public Deck()
| Method Detail |
|---|
public Card deal()
public void shuffle()
public void reset()
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 | |||||||