All Packages Class Hierarchy This Package Previous Next Index
Class java.lancs.Card
java.lang.Object
|
+----java.lancs.Card
- public class Card
- extends Object
-
CLUBS
- Constant - Clubs
-
DIAMONDS
- Constant - Diamonds
-
HEARTS
- Constant - Hearts
-
SPADES
- Constant - Spades
-
Card()
- Creates an instance of the Card class with random values
(if all have been dealt, then starts again)
-
Card(int, int)
- Creates an instance of the Card class with specified values
(if all have been dealt, then starts again)
-
getSuit()
- returns the suit attribute of the card
-
getSuitString()
- returns the suit attribute of the card as a string
-
getValue()
- returns the value attribute of the card
-
getValueString()
- returns the value attribute of the card as a string
-
restart()
- Resets the deck of cards to all undealt
-
toString()
- return a string representing the card
SPADES
public static final int SPADES
- Constant - Spades
HEARTS
public static final int HEARTS
- Constant - Hearts
CLUBS
public static final int CLUBS
- Constant - Clubs
DIAMONDS
public static final int DIAMONDS
- Constant - Diamonds
Card
public Card()
- Creates an instance of the Card class with random values
(if all have been dealt, then starts again)
Card
public Card(int s,
int v)
- Creates an instance of the Card class with specified values
(if all have been dealt, then starts again)
- Parameters:
- s - suit of the card
- v - value of the card
getSuit
public int getSuit()
- returns the suit attribute of the card
- Returns:
- the suit attribute of the card
getSuitString
public String getSuitString()
- returns the suit attribute of the card as a string
- Returns:
- the suit attribute of the card as a string
getValue
public int getValue()
- returns the value attribute of the card
- Returns:
- the value attribute of the card
getValueString
public String getValueString()
- returns the value attribute of the card as a string
- Returns:
- the value attribute of the card as a string
restart
public static void restart()
- Resets the deck of cards to all undealt
toString
public String toString()
- return a string representing the card
- Returns:
- details of the card ('value of suit')
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index