01 /*
02 Copyright (c) 2005 Garrett Smith
03 The MIT License
04 
05 Permission is hereby granted, free of charge, to any person obtaining a copy 
06 of this software and associated documentation files (the "Software"), to deal
07 in the Software without restriction, including without limitation the rights
08 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 
09 copies of the Software, and to permit persons to whom the Software is 
10 furnished to do so, subject to the following conditions:
11 
12 The above copyright notice and this permission notice shall be included in all 
13 copies or substantial portions of the Software.
14 
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
18 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
19 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
21 THE SOFTWARE.
22 */
23 
24 // $Id: Deck.java.html,v 1.1 2005/06/14 06:50:55 gsmith Exp $
25 
26 package garrettsmith.playingcards;
27 
28 import java.util.List;
29 
30 /**
31  <p>
32  * Abstractly represents a deck of playing cards with a type distribution.
33  * The exact number and type of cards contained in the deck is defined by the
34  * concrete class that implements this interface.
35  </p><p>
36  * Any class inmplementing this interface should have a public default no-arg
37  * constructor.
38  </p>
39  @author Garrett Smith, gsmith at northwestern dot edu
40  @version Blackjack v1.0
41  @since Blackjack v1.0
42  */
43 public interface Deck {
44 
45     /**
46      * Returns a nonrandom list of all cards contained in a fresh deck.
47      * Invoking this method does not change the state of this deck.
48      *
49      @return <code>CardList</code> of {@link Card}s
50      */
51     public abstract
52     List getAllCards();
53 
54     /**
55      * Returns the total number of cards in the deck.
56      *
57      @return the total number of cards in the deck.
58      */
59     public abstract
60     int size();
61 
62     /**
63      * Returns the number of cards in the deck whose color is equal to <code>color</code>.
64      */
65     public abstract
66     int getNumCardsOfTypeCard.Color color );
67 
68     /**
69      * Returns the number of cards in the deck whose suit is equal to <code>suite</code>.
70      */
71     public abstract
72     int getNumCardsOfTypeCard.Suit suit );
73 
74     /**
75      * Returns the number of cards in the deck whose value is equal to <code>value</code>.
76      */
77     public abstract
78     int getNumCardsOfTypeCard.Value value );
79 
80 // interface Deck