com.javaflair.pokerprophesier.api.card
Class Deck

java.lang.Object
  extended by com.javaflair.pokerprophesier.api.card.Deck

public class Deck
extends Object

A representation of a deck of cards as an array of Cards, with associated methods to create, crop and shuffle a deck.

Author:
Javaflair
See Also:
Card

Field Summary
static int TOTAL_CARDS_IN_PACK
          Default number of cards in a pack.
 
Method Summary
static Card[] getCroppedDeck(Card[] usedCards)
          Returns a full deck of cards with the specified array of used cards removed.
static Card[] getCroppedDeck(Card[] deck, Card[] usedCards)
          Returns the deck of cards with the specified array of used cards removed.
static Card[] getFullDeck()
          Returns a full deck of ordered cards.
static Card[] getShuffledDeck(Card[] deck)
          Shuffles and then returns the specified deck of cards.
static String toString(Card[] deck)
          Returns a String representation of the specified deck of cards.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOTAL_CARDS_IN_PACK

public static final int TOTAL_CARDS_IN_PACK
Default number of cards in a pack.

See Also:
Constant Field Values
Method Detail

getCroppedDeck

public static Card[] getCroppedDeck(Card[] usedCards)
Returns a full deck of cards with the specified array of used cards removed.

Parameters:
usedCards - the used cards to remove
Returns:
the remaining cards

getCroppedDeck

public static Card[] getCroppedDeck(Card[] deck,
                                    Card[] usedCards)
Returns the deck of cards with the specified array of used cards removed.

Parameters:
deck - the deck of cards
usedCards - the used cards to remove
Returns:
the remaining cards

getFullDeck

public static Card[] getFullDeck()
Returns a full deck of ordered cards.

Returns:
the full deck

getShuffledDeck

public static Card[] getShuffledDeck(Card[] deck)
Shuffles and then returns the specified deck of cards.

Parameters:
deck - the deck of cards to shuffle
Returns:
the shuffled deck

toString

public static String toString(Card[] deck)
Returns a String representation of the specified deck of cards.

Parameters:
deck - the deck of cards
Returns:
the String representation


Copyright © 2006 Javaflair. All Rights Reserved.