All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.lancs.Card

java.lang.Object
   |
   +----java.lancs.Card

public class Card
extends Object

Variable Index

 o CLUBS
Constant - Clubs
 o DIAMONDS
Constant - Diamonds
 o HEARTS
Constant - Hearts
 o SPADES
Constant - Spades

Constructor Index

 o Card()
Creates an instance of the Card class with random values (if all have been dealt, then starts again)
 o Card(int, int)
Creates an instance of the Card class with specified values (if all have been dealt, then starts again)

Method Index

 o getSuit()
returns the suit attribute of the card
 o getSuitString()
returns the suit attribute of the card as a string
 o getValue()
returns the value attribute of the card
 o getValueString()
returns the value attribute of the card as a string
 o restart()
Resets the deck of cards to all undealt
 o toString()
return a string representing the card

Variables

 o SPADES
 public static final int SPADES
Constant - Spades

 o HEARTS
 public static final int HEARTS
Constant - Hearts

 o CLUBS
 public static final int CLUBS
Constant - Clubs

 o DIAMONDS
 public static final int DIAMONDS
Constant - Diamonds

Constructors

 o Card
 public Card()
Creates an instance of the Card class with random values (if all have been dealt, then starts again)

 o 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

Methods

 o getSuit
 public int getSuit()
returns the suit attribute of the card

Returns:
the suit attribute of the card
 o getSuitString
 public String getSuitString()
returns the suit attribute of the card as a string

Returns:
the suit attribute of the card as a string
 o getValue
 public int getValue()
returns the value attribute of the card

Returns:
the value attribute of the card
 o getValueString
 public String getValueString()
returns the value attribute of the card as a string

Returns:
the value attribute of the card as a string
 o restart
 public static void restart()
Resets the deck of cards to all undealt

 o 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