rolec
Class Deck

java.lang.Object
  extended by rolec.Deck

public class Deck
extends java.lang.Object

This class represents the Deck of cards in a game of Frank's Zoo


Constructor Summary
Deck(int i, org.jdom.Element root)
          Constructs a new deck of cards
 
Method Summary
 java.util.Vector cards()
          Returns a Vector containing all Cards in the Deck
 int[] getCards()
          Returns the cards in the deck
 Card getType(int i)
          Returns the Card with a specific ID
 Card[] getTypes()
          Returns the various types of cards in the deck
 void print()
          Prints the deck
 int size()
          Returns the number of cards in the deck
 java.lang.String toString()
          Returns a String representation of the deck
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Deck

public Deck(int i,
            org.jdom.Element root)
Constructs a new deck of cards

Parameters:
i - the number of different types of cards in the deck
Method Detail

getTypes

public Card[] getTypes()
Returns the various types of cards in the deck

Returns:
an array containing the various types of cards in the deck

getType

public Card getType(int i)
Returns the Card with a specific ID

Parameters:
i - the ID of the card to be returned
Returns:
the Card with the specified

getCards

public int[] getCards()
Returns the cards in the deck

Returns:
an array containing the cards in the deck. Each slot in the array represents one type of card (the number of the slot equals the ID of the card). The integer in the slot indicates the number of cards of the player is holding of this specific type of card. For instance, if int[5] = 3, then the player is holding 3 cards with ID 5.

cards

public java.util.Vector cards()
Returns a Vector containing all Cards in the Deck

Returns:
a Vector containing all Cards in the Deck

toString

public java.lang.String toString()
Returns a String representation of the deck

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the deck

size

public int size()
Returns the number of cards in the deck

Returns:
the number of cards in the deck

print

public void print()
Prints the deck