// Deck.java - John K. Estell - 8 May 2003 // last modified: 23 Febraury 2004 // Implementation of a deck of playing cards. Uses the Card class. import java.util.*; /** * Represents a deck of playing cards. In order to have maximum flexibility, * this class does not implement a standard deck of playing cards; it only * provides the functionality of a deck of cards. The client programmer must * instantiate a Deck object, then populate it with the set of playing cards * appropriate for the card game being implemented. This allows for proper * implementation of card games such as pinochle (a 48-card deck containing * only aces, nines, tens, jacks, queens, and kings in all four suits, with * each card present twice in the deck) or casino-style blackjack (where six * standard decks are used for a game). * @author John K. Estell * @version 1.0 */ public class Deck { // instance variables for the deck // your code goes here /** * Creates an empty deck of cards. */ public Deck() { // your code goes here } /** * Adds a card to the deck. * @param card card to be added to the deck. */ public void addCard( Card card ) { // your code goes here } /** * The size of a deck of cards. * @return the number of cards present in the full deck. */ public int getSizeOfDeck() { // your code goes here } /** * The number of cards left in the deck. * @return the number of cards left to be dealt from the deck. */ public int getNumberOfCardsRemaining() { // your code goes here } /** * Deal one card from the deck. * @return a card from the deck, or the null reference if there * are no cards left in the deck. */ public Card dealCard() { // your code goes here } /** * Shuffles the cards present in the deck. */ public void shuffle() { // your code goes here } /** * Looks for an empty deck. * @return true if there are no cards left to be dealt from the deck. */ public boolean isEmpty() { // your code goes here } /** * Restores the deck to "full deck" status. */ public void restoreDeck() { // your code goes here } }