public class Card extends java.lang.Object implements java.lang.Comparable<Card>, java.io.Serializable
compareTo()
, null
suits and values are
before all others.jpleal@fc.up.pt
equals()
)
using Eclipse commands.Modifier and Type | Method and Description |
---|---|
int |
compareTo(Card o) |
boolean |
equals(java.lang.Object obj) |
CardSuit |
getSuit() |
CardValue |
getValue() |
int |
hashCode() |
java.lang.String |
toString()
Show the card as a short string with value and suit
given by the
toString() methods of these enumerations. |
public CardSuit getSuit()
public CardValue getValue()
public int compareTo(Card o)
compareTo
in interface java.lang.Comparable<Card>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString()
methods of these enumerations.
(ex: 2♣, K♣, 10♣, 9♦, J♦,
7♥, Q♥, 2♠, A♠).
Jokers are cards with null value represented as an asterisk (*).toString
in class java.lang.Object