proj3
Enum Suit

java.lang.Object
  extended by java.lang.Enum<Suit>
      extended by proj3.Suit
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Suit>

public enum Suit
extends java.lang.Enum<Suit>

The Suit enum encapsulates each of the 4 suits of a standard deck of playing cards. Using this enum assures that all code refers to the suits in the same manner, i.e Suit.CLUBS, Suit.DIAMONDS, Suit.HEARTS, and Suit.SPADES with no possibility of conflicting representations.

This enum is provided for you — you must not change it.

Author:
Susan M. Mitchell (Created: 10 Nov 2007), Daniel J. Hood (Modified: 23 Mar 2011)

Enum Constant Summary
CLUBS
          The suit CLUBS
DIAMONDS
          The suit DIAMONDS
HEARTS
          The suit HEARTS
SPADES
          The suit SPADES
 
Method Summary
 java.lang.String getName()
          Returns the name for the suit (e.g.
 char getSymbol()
          Returns the symbol for the suit (e.g.
static Suit valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Suit[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

CLUBS

public static final Suit CLUBS
The suit CLUBS


DIAMONDS

public static final Suit DIAMONDS
The suit DIAMONDS


HEARTS

public static final Suit HEARTS
The suit HEARTS


SPADES

public static final Suit SPADES
The suit SPADES

Method Detail

values

public static Suit[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Suit c : Suit.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Suit valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getSymbol

public char getSymbol()
Returns the symbol for the suit (e.g. SPADES → 's').

Returns:
the symbol

getName

public java.lang.String getName()
Returns the name for the suit (e.g. SPADES → "Spades").

Returns:
the name