Class Card

java.lang.Object
  extended by Card

public class Card
extends java.lang.Object

This class stores information about a specific card.


Nested Class Summary
static class Card.Rank
          Enumerated type for card ranks
static class Card.Suit
          Enumerated type for card suits
 
Constructor Summary
Card(Card.ProtoCard prototype, boolean isFaceUp)
          Constructor initializes data elements
 
Method Summary
 int compareTo(Card c2)
          Compares two cards
 void flipCard()
          Manipulator for card orientation
static java.awt.Image getBackSide()
          Accessor for image of card back
 java.awt.Image getFrontSide()
          Accessor for image of this card
 boolean getIsFaceUp()
          Accessor for card orientation
 Card.Rank getRank()
          Accessor for rank of this card
static void loadImages(java.awt.Component c)
          Make sure images have loaded
static Card[] newDeck()
          Generates a new deck of face-down cards
 Card.Suit suit()
          Accessor for suit of this card
 java.lang.String toString()
          Text description of card = RANK of SUIT
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Card

public Card(Card.ProtoCard prototype,
            boolean isFaceUp)
Constructor initializes data elements

Method Detail

getIsFaceUp

public boolean getIsFaceUp()
Accessor for card orientation


flipCard

public void flipCard()
Manipulator for card orientation


getRank

public Card.Rank getRank()
Accessor for rank of this card


suit

public Card.Suit suit()
Accessor for suit of this card


toString

public java.lang.String toString()
Text description of card = RANK of SUIT

Overrides:
toString in class java.lang.Object

getFrontSide

public java.awt.Image getFrontSide()
Accessor for image of this card


getBackSide

public static java.awt.Image getBackSide()
Accessor for image of card back


compareTo

public int compareTo(Card c2)
Compares two cards


newDeck

public static Card[] newDeck()
Generates a new deck of face-down cards


loadImages

public static void loadImages(java.awt.Component c)
Make sure images have loaded

Parameters:
c - Component that will use these images