program4
Class Deck

java.lang.Object
  extended by program4.Deck

public class Deck
extends java.lang.Object

Title: The Deck Class

Description: Defines the properties and behaviors of a Deck of Cards.

Author:
F. Graham

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

cards

private java.util.ArrayList<Card> cards
ArrayList of Cards

Constructor Detail

Deck

public Deck()
Method Detail

initialize

public void initialize()
Generates 52 Cards and stores them in the ArrayList


toString

public java.lang.String toString()
Returns a string representation of the Deck

Overrides:
toString in class java.lang.Object
Returns:
String representation of the list of Cards in the Deck

shuffle

public void shuffle()
Shuffles the Deck of Cards


deal

public Card deal()
Returns a card from the Deck

Returns:
returns a Card from the Deck

isEmpty

public boolean isEmpty()
Returns true if the Deck is empty

Returns:
Returns true if the Deck is empty, false otherwise