|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.blackledge.david.game.solitaire.Card
public class Card
Represents a Playing Card
Field Summary | |
---|---|
static int |
ACE
Constant for a Card Value as returned by getValue() - the Ace is
valued as 1 here. |
static int |
BLACK
Constant for a suit color as returned by getSuitColor() |
static int |
CLUB
Constant for a suit as returned by getSuit() |
static int |
DIAMOND
Constant for a suit as returned by getSuit() |
static int |
HEART
Constant for a suit as returned by getSuit() |
static int |
JACK
Constant for a Card Value as returned by getValue() |
static int |
KING
Constant for a Card Value as returned by getValue() |
static int |
QUEEN
Constant for a Card Value as returned by getValue() |
static int |
RED
Constant for a suit color as returned by getSuitColor() |
static int |
SPADE
Constant for a suit as returned by getSuit() |
Constructor Summary | |
---|---|
Card(int suit,
int value,
boolean faceUp)
Create a card with the given suit, value, and face-up state. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Check if two cards are equal (same suit, same value - ignores faceUp) |
static int |
getMaxValue()
The maximum valid value for a card |
static int |
getMinValue()
The minimum valid value for a card |
int |
getSuit()
|
int |
getSuitColor()
|
int |
getValue()
|
String |
getValueString()
1==A, 11==J, 12==Q, 13==K, all others are integers in string form. |
int |
hashCode()
have to implement so hashmap works right. |
boolean |
isFaceUp()
Report whether this card is currently face up. |
void |
setFaceUp(boolean faceUp)
Set whether this card is currently face up. |
String |
toString()
|
boolean |
turnOver()
Turns this card over. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int HEART
getSuit()
public static final int CLUB
getSuit()
public static final int DIAMOND
getSuit()
public static final int SPADE
getSuit()
public static final int RED
getSuitColor()
public static final int BLACK
getSuitColor()
public static final int KING
getValue()
public static final int QUEEN
getValue()
public static final int JACK
getValue()
public static final int ACE
getValue()
- the Ace is
valued as 1 here.
Constructor Detail |
---|
public Card(int suit, int value, boolean faceUp)
suit
- value
- Method Detail |
---|
public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
Object.hashCode()
public static int getMinValue()
public static int getMaxValue()
public int getSuit()
public int getValue()
public String getValueString()
public int getSuitColor()
public boolean isFaceUp()
public void setFaceUp(boolean faceUp)
faceUp
- public boolean turnOver()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |