Class Card

java.lang.Object
  extended by Card

public class Card
extends Object


Constructor Summary
Card(int s, int c)
          Creates a card
 
Method Summary
 boolean equals(Card c)
          Determines if two cards have the same cardNum values.
 int getBlackJackValue()
          Determines the Blackjack value of a card.
 String getCardName()
          Converts the cardNum to a String value where 14 is Ace 13 is King 12 is Queen 11 is Jack numbered cards are returned as the card number.
 int getOrder()
          Returns the card number.
 String getSuitName()
          Converts the suitNum to a string representing the suit.
 int getSuitValue()
          Accessor that returns the suit value.
 boolean isAce()
          Determines if a card is an Ace.
 boolean isFaceCard()
          Determines if a card is a face card with cardNum values of 11-13 Face cards - Jack, Queen, and King.
 String toString()
          Returns the card in the form of the card name and the suit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Card

public Card(int s,
            int c)
Creates a card

Parameters:
s - the suit value (1-4)
c - the card value (2-14) 2-two 3-three ... 10-ten 11-jack 12-queen 13-king 14-ace
Method Detail

equals

public boolean equals(Card c)
Determines if two cards have the same cardNum values.

Returns:
true if the cardNum values are the same, false otherwise.

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 

 


getBlackJackValue

public int getBlackJackValue()
Determines the Blackjack value of a card. Face cards have a value of 10, Ace is 11, and number cards are the value of the number.

Returns:
card value in Blackjack

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 

 


getCardName

public String getCardName()
Converts the cardNum to a String value where 14 is Ace 13 is King 12 is Queen 11 is Jack numbered cards are returned as the card number.

Returns:
String representation of the card

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 


getOrder

public int getOrder()
Returns the card number. A value between 2 and 14 14-Ace 13-King 12-Queen 11-Jack 10-Ten ... 2-Two

Returns:
A number between 2 and 14

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 


getSuitName

public String getSuitName()
Converts the suitNum to a string representing the suit.

Returns:
String representation of the suit.

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 


getSuitValue

public int getSuitValue()
Accessor that returns the suit value. Suit values 1-4

Returns:
suit value of the card which will represent clubs, spades, hearts, and diamonds. 1-clubs 2-hearts 3-spades 4-clubs

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 


isAce

public boolean isAce()
Determines if a card is an Ace.

Returns:
true if the cardNum is a 14 which represents an Ace. false otherwise.

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 


isFaceCard

public boolean isFaceCard()
Determines if a card is a face card with cardNum values of 11-13 Face cards - Jack, Queen, and King.

Returns:
true if a face card. False otherwise.

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L

 

 


toString

public String toString()
Returns the card in the form of the card name and the suit. Examples : Ace of Clubs or King of Spades

Overrides:
toString in class Object
Returns:
Description of the card containing the name and suit.

 

 

Student Name : H K N O P Sh Sm W L


Student Email :  H K N O P Sh Sm W L