public class Card2 extends java.lang.Object implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
ACE |
static int |
CLUBS |
static int |
DIAMONDS |
static int |
HEARTS |
static int |
KING |
private int |
number |
private static long |
serialVersionUID |
static int |
SPADES |
private int |
suit |
static int |
UNASSIGNED |
Constructor and Description |
---|
Card2(int number,
int suit) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getNumber() |
int |
getSuit() |
int |
hashCode() |
static boolean |
isValidNumber(int number) |
static boolean |
isValidSuit(int suit) |
static java.lang.String |
numberToString(int number) |
private void |
readObject(java.io.ObjectInputStream s) |
static java.lang.String |
suitToString(int suit) |
java.lang.String |
toString() |
private void |
writeObject(java.io.ObjectOutputStream s) |
private static final long serialVersionUID
private int suit
private int number
public static final int UNASSIGNED
public static final int DIAMONDS
public static final int CLUBS
public static final int HEARTS
public static final int SPADES
public static final int ACE
public static final int KING
public Card2(int number, int suit)
public int getSuit()
public int getNumber()
public static boolean isValidNumber(int number)
public static boolean isValidSuit(int suit)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String numberToString(int number)
public static java.lang.String suitToString(int suit)
private void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException
java.io.IOException
private void readObject(java.io.ObjectInputStream s) throws java.io.IOException
java.io.IOException