Package  

 Class 

Tree 

Deprecated 

Index 

Help 

 

 PREV CLASS   NEXT CLASS

FRAMES    NO FRAMES     All Classes

 

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

 

size=2 width="100%" align=center>

Class Deck

java.lang.Object
  extended byDeck

public class Deck

extends java.lang.Object

An encapsulation of a (52-card) deck of "playing cards"


Constructor Summary

Deck()
          Default Constructor Note: When a Deck is constructed it is not shuffled

 

 

Method Summary

 boolean

hasMoreCards()
          Determine if this Deck has any cards that have not yet been dealt

 Card

nextCard()
          Get the next Card in this Deck (if one is available)

 void

shuffle()
          Shuffle this Deck of cards (using the Fisher-Yates algorithm)

 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

Deck

public Deck()

Default Constructor Note: When a Deck is constructed it is not shuffled

Method Detail

hasMoreCards

public boolean hasMoreCards()

Determine if this Deck has any cards that have not yet been dealt

Returns:

true if another Card can be dealt, false otherwise


nextCard

public Card nextCard()

Get the next Card in this Deck (if one is available)

Returns:

The next Card (or null if no Card is available)


shuffle

public void shuffle()

Shuffle this Deck of cards (using the Fisher-Yates algorithm)

size=2 width="100%" align=center>

 

Package  

 Class 

Tree 

Deprecated 

Index 

Help 

 

 PREV CLASS   NEXT CLASS

FRAMES    NO FRAMES     All Classes

 

SUMMARY: NESTED | FIELD | CONSTR | METHOD

DETAIL: FIELD | CONSTR | METHOD

 

size=2 width="100%" align=center>