public class Card
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Card[] |
allCards
an array of all unique Card objects
|
static java.lang.String[] |
rankNames
array of abbreviated card rank names in ascending order of rank
|
static boolean[] |
suitIsRed
parallel array to suitNames indicating whether or not the corresponding suit is red
|
static java.lang.String[] |
suitNames
array of abbreviated card suit names with lowercase red suits
|
Constructor and Description |
---|
Card(int rank,
int suit)
Constructor to create a card object with the corresponding zero-based indices to rankNames and suitNames, respectively
|
Modifier and Type | Method and Description |
---|---|
int |
getRank()
Get rank of card (zero-based index to rankNames).
|
int |
getSuit()
Get suit of card (zero-based index to suitNames).
|
java.lang.String |
toString() |
public static Card[] allCards
public static java.lang.String[] rankNames
public static java.lang.String[] suitNames
public static boolean[] suitIsRed
public Card(int rank, int suit)
rank
- rank of card (zero-based index to rankNames)suit
- suit of card (zero-based index to suitNames)public int getRank()
public int getSuit()
public java.lang.String toString()
toString
in class java.lang.Object