|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprogram4.Deck
public class Deck
Title: The Deck Class
Description: Defines the properties and behaviors of a Deck of Cards.
Field Summary | |
---|---|
private java.util.ArrayList<Card> |
cards
ArrayList of Cards |
Constructor Summary | |
---|---|
Deck()
|
Method Summary | |
---|---|
Card |
deal()
Returns a card from the Deck |
void |
initialize()
Generates 52 Cards and stores them in the ArrayList |
boolean |
isEmpty()
Returns true if the Deck is empty |
void |
shuffle()
Shuffles the Deck of Cards |
java.lang.String |
toString()
Returns a string representation of the Deck |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.ArrayList<Card> cards
Constructor Detail |
---|
public Deck()
Method Detail |
---|
public void initialize()
public java.lang.String toString()
toString
in class java.lang.Object
public void shuffle()
public Card deal()
public boolean isEmpty()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |