|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgarrettsmith.playingcards.Card
public final class Card
Represents a card in a typical deck of playing cards. Card is immutable, and, therefore, thread safe.
| Nested Class Summary | |
|---|---|
static class |
Card.Color
Represents the card's color: red, black, or none. |
static class |
Card.Suit
Represents a card's suit, such as spades or clubs. |
static class |
Card.Value
Represents a card's value: two, queen, or ace, for example. |
| Constructor Summary | |
|---|---|
Card()
Creates a joker. |
|
Card(Card.Value value,
Card.Suit suit)
Creates a new card with the specified suit and value. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object object)
Returns whether the object referred to in the object parameter is equal to this instance. |
Card.Color |
getColor()
Returns a string representation of this card's color. |
Card.Suit |
getSuit()
Returns the card's suit. |
Card.Value |
getValue()
Returns the card's value. |
int |
hashCode()
Returns a hash value for this card. |
java.lang.String |
toString()
Returns a string representation this card's state. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Card()
public Card(Card.Value value,
Card.Suit suit)
Creates a new card with the specified suit and value.
suit - the card's suit, for example, heartsvalue - the card's value, for example, a ten| Method Detail |
|---|
public boolean equals(java.lang.Object object)
object parameter is equal to this instance.
equals in class java.lang.Objectpublic Card.Color getColor()
public Card.Suit getSuit()
public Card.Value getValue()
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
-footer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||