-footer

garrettsmith.playingcards
Interface Deck

All Known Implementing Classes:
StandardDeck

public interface Deck

Abstractly represents a deck of playing cards with a type distribution. The exact number and type of cards contained in the deck is defined by the concrete class that implements this interface.

Any class inmplementing this interface should have a public default no-arg constructor.

Since:
Blackjack v1.0
Version:
Blackjack v1.0
Author:
Garrett Smith, gsmith at northwestern dot edu

Method Summary
 java.util.List getAllCards()
          Returns a nonrandom list of all cards contained in a fresh deck.
 int getNumCardsOfType(Card.Color color)
          Returns the number of cards in the deck whose color is equal to color.
 int getNumCardsOfType(Card.Suit suit)
          Returns the number of cards in the deck whose suit is equal to suite.
 int getNumCardsOfType(Card.Value value)
          Returns the number of cards in the deck whose value is equal to value.
 int size()
          Returns the total number of cards in the deck.
 

Method Detail

getAllCards

java.util.List getAllCards()
Returns a nonrandom list of all cards contained in a fresh deck. Invoking this method does not change the state of this deck.

Returns:
a CardList of Cards

size

int size()
Returns the total number of cards in the deck.

Returns:
the total number of cards in the deck.

getNumCardsOfType

int getNumCardsOfType(Card.Color color)
Returns the number of cards in the deck whose color is equal to color.


getNumCardsOfType

int getNumCardsOfType(Card.Suit suit)
Returns the number of cards in the deck whose suit is equal to suite.


getNumCardsOfType

int getNumCardsOfType(Card.Value value)
Returns the number of cards in the deck whose value is equal to value.


-footer

Copyright 2001-5 Garrett Smith. Use is subject to license terms.