Class Deck

java.lang.Object
  extended by Deck

public class Deck
extends java.lang.Object


Constructor Summary
Deck()
          Constructs a Deck of 52 playing cards.
 
Method Summary
 void dealCards(Card[] pile1, Card[] pile2)
          Deals this Deck of cards to the two passed arrays.
static void main(java.lang.String[] args)
          Main allows us to test the methods in this Deck class
 void shuffle()
          Shuffles this Deck object.
 java.lang.String toString()
          returns the string representation of this Deck object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Deck

public Deck()
Constructs a Deck of 52 playing cards.

Method Detail

shuffle

public void shuffle()
Shuffles this Deck object. Swaps each card in the deck with a randomly chosen card.


dealCards

public void dealCards(Card[] pile1,
                      Card[] pile2)
Deals this Deck of cards to the two passed arrays. Those arrays can be used later, in the caller class, to fill in stacks, queues, or other data structures, as needed.


toString

public java.lang.String toString()
returns the string representation of this Deck object

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

main

public static void main(java.lang.String[] args)
Main allows us to test the methods in this Deck class