public class Card
extends java.lang.Object
Constructor and Description |
---|
Card(java.lang.String suit,
int value)
Constructs a card with the given suit and given value
See class comment for what values suit and value should take.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Card other)
Returns true if other has the same suit and value, false otherwise
|
java.lang.String |
getSuit()
Returns the suit of this card
|
int |
getValue()
Returns the value of this card
|
java.lang.String |
toString()
Example: The Jack of Clubs would return "[C 11]"
|
public Card(java.lang.String suit, int value)
suit
- Suit for the card. Should be one of "S", "C", "H", "D"value
- The value of the card. Should be a number between 1-13public java.lang.String getSuit()
public int getValue()
public boolean equals(Card other)
other
- The card to comparepublic java.lang.String toString()
toString
in class java.lang.Object