/**
 * Represents a playing card used for Blackjack
 */
public class BlackjackCard
{
    public static final int ACE_VALUE = 1;
    public static final int JACK_VALUE = 11;
    public static final int QUEEN_VALUE = 12;
    public static final int KING_VALUE = 13;

    private static final int FACE_CARD_NUMERICAL_VALUE = 10;

    private int value;
    private String suit;

    /**
     * Constructs a card with the specified value and suit
     * @param value ACE_VALUE, 2 - 10, JACK_VALUE, QUEEN_VALUE, KING_VALUE
     * @param suit "D", "H", "S", or "C"
     * @throws IllegalArgumentException if value and/or suit is invalid
     */
    public BlackjackCard(int value, String suit)
    {
        if(! (ACE_VALUE <= value && value <= KING_VALUE) )
            throw new IllegalArgumentException(
                    "value must be  one of ACE_VALUE, 2 - 10, JACK_VALUE, QUEEN_VALUE, KING_VALUE");

        final String suits = "DHSC";
        
        if(suit.length() != 1 || suits.indexOf(suit) == -1)
            throw new IllegalArgumentException(
                    "suit must be one of \"D\", \"H\", \"S\", \"C\"");

        this.suit = suit;
        this.value = value;
    }

    /**
     * Return this card's value
     * (ACE_VALUE, 2 - 10, JACK_VALUE, QUEEN_VALUE, KING_VALUE)
     * @return this card's value
     */
    public int getValue()
    {
        return value;
    }

    /**
     * Returns this card's suit
     * ("D", "H", "S" or "C")
     * @return this card's suit
     */
    public String getSuit()
    {
        return suit;
    }

    /**
     * Returns true if this card is an ace, false otherwise
     * @return if this card is an ace
     */
    public boolean isAce()
    {
        return false; // TODO implement
    }

    /**
     * Returns the numerical value of this card according
     * to the rules of blackjack. Returns 1 for an ace.
     * @return the numerical value according to blackjack rules
     */
    public int getNumericalValue()
    {
        return -1; // TODO implement
    }

    /**
     * Returns a string representation of this card with
     * the 1 or 2 character value (A, 2 - 10, J, Q, K) followed
     * by the 1 character suit (D, H, S, C)
     * Examples: "JD", "10H", "AS", "9C"
     * @return a string representation of this card
     */
    public String toString()
    {
        return null; // TODO implement
    }
}
