|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
The Card interface defines a basic card that can be used in various kinds of games. It represents the name, suit, value, and front/back images of a card. It also defines useful constants for card names and suits.
| Field Summary | |
static java.lang.String |
ACE
This value represents the card name "Ace" |
static java.lang.String |
CLUB
This value represents the card suit "Club" |
static java.lang.String |
DIAMOND
This value represents the card suit "Diamond" |
static java.lang.String |
EIGHT
This value represents the card name "Eight" |
static java.lang.String |
FIVE
This value represents the card name "Five" |
static java.lang.String |
FOUR
This value represents the card name "Four" |
static java.lang.String |
HEART
This value represents the card suit "Heart" |
static java.lang.String |
JACK
This value represents the card name "Jack" |
static java.lang.String |
KING
This value represents the card name "King" |
static java.lang.String |
NINE
This value represents the card name "Nine" |
static java.lang.String |
QUEEN
This value represents the card name "Queen" |
static java.lang.String |
SEVEN
This value represents the card name "Seven" |
static java.lang.String |
SIX
This value represents the card name "Six" |
static java.lang.String |
SPADE
This value represents the card suit "Spade" |
static java.lang.String |
TEN
This value represents the card name "Ten" |
static java.lang.String |
THREE
This value represents the card name "Three" |
static java.lang.String |
TWO
This value represents the card name "Two" |
| Method Summary | |
boolean |
equals(Card theOtherCard)
The public method equals checks whether two Cards have the same name and suit, and returns a boolean result. |
java.lang.String |
getBackImageFileName()
The public method getBackImageFileName returns the file name containing the Card's back image. |
java.lang.String |
getFrontImageFileName()
The public method getFrontImageFileName returns the file name containing the Card's front image. |
java.lang.String |
getName()
The public method getName returns the name of the Card. |
java.lang.String |
getSuit()
The public method getSuit returns the suit of the Card. |
int |
getValue()
The public method getValue returns the numeric value of the Card. |
boolean |
getVisibility()
The public method getVisibility is used to retrieve the current state of a Card's visibility. |
void |
setBackImageFileName(java.lang.String backImageFile)
The public method setBackImageFileName specifies the file name containing the Card's back image. |
void |
setFrontImageFileName(java.lang.String frontImageFile)
The public method setFrontImageFileName specifies the file name containing the Card's front image. |
void |
setName(java.lang.String cardName)
The public method setName sets the name of the Card. |
void |
setSuit(java.lang.String cardSuit)
The public method setSuit sets the suit of the Card. |
void |
setValue(int cardValue)
The public method setValue sets the numeric value of the Card. |
void |
setVisibility(boolean visible)
The public method setVisibility is used to set a Card's current state of visibility. |
java.lang.String |
toString()
The public method toString returns the String representation of the Card, such as "Ace of Spades." |
| Field Detail |
public static final java.lang.String ACE
public static final java.lang.String TWO
public static final java.lang.String THREE
public static final java.lang.String FOUR
public static final java.lang.String FIVE
public static final java.lang.String SIX
public static final java.lang.String SEVEN
public static final java.lang.String EIGHT
public static final java.lang.String NINE
public static final java.lang.String TEN
public static final java.lang.String JACK
public static final java.lang.String QUEEN
public static final java.lang.String KING
public static final java.lang.String HEART
public static final java.lang.String SPADE
public static final java.lang.String DIAMOND
public static final java.lang.String CLUB
| Method Detail |
public java.lang.String getName()
public void setName(java.lang.String cardName)
cardName - the name of the Card as a String.public java.lang.String getSuit()
public void setSuit(java.lang.String cardSuit)
cardSuit - the suit of the Card as a String.public int getValue()
public void setValue(int cardValue)
cardValue - the numeric value of the Card as an int.public java.lang.String getFrontImageFileName()
public void setFrontImageFileName(java.lang.String frontImageFile)
FrontImageFileName - the String value of the front image file name.public java.lang.String getBackImageFileName()
public void setBackImageFileName(java.lang.String backImageFile)
FrontImageFileName - the String value of the back image file name.public boolean getVisibility()
public void setVisibility(boolean visible)
visible - the boolean value true (face up) or false (face down).public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(Card theOtherCard)
theOtherCard - - the Card to be compared with this Card.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||