Class Deck

java.lang.Object
  |
  +--java.util.Observable
        |
        +--Deck

public class Deck
extends Observable


Constructor Summary
Deck()
          Creates a full deck.
 
Method Summary
 Card drawCard()
          Removes (and returns) a card from the deck.
 int numberOfCards()
          Returns the number of cards currently in the deck.
 void reset()
          Resets the deck so that it contains a full set of cards.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deck

public Deck()
Creates a full deck.

Method Detail

drawCard

public Card drawCard()
Removes (and returns) a card from the deck.

Returns:
A random card from the deck, or null if the deck is empty.

numberOfCards

public int numberOfCards()
Returns the number of cards currently in the deck.

Returns:
The number of cards currently in the deck.

reset

public void reset()
Resets the deck so that it contains a full set of cards.