proj3
Enum Rank

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

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

The Rank enum encapsulates each of the 13 ranks of a standard deck of playing cards. Using this enum assures that all code refers to the ranks in the same manner. i.e. Rank.ACE, Rank.TWO, ..., Rank.QUEEN, Rank.KING 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
ACE
          The rank ACE
EIGHT
          The rank EIGHT (8)
FIVE
          The rank FIVE (5)
FOUR
          The rank FOUR (4)
JACK
          The rank JACK
KING
          The rank KING
NINE
          The rank NINE (9)
QUEEN
          The rank QUEEN
SEVEN
          The rank SEVEN (7)
SIX
          The rank SIX (6)
TEN
          The rank TEN (10)
THREE
          The rank THREE (3)
TWO
          The rank TWO (2)
 
Method Summary
 java.lang.String getName()
          Returns the name for the suit (e.g.
 char getSymbol()
          Returns the symbol for the rank (e.g.
static Rank valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Rank[] 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

ACE

public static final Rank ACE
The rank ACE


TWO

public static final Rank TWO
The rank TWO (2)


THREE

public static final Rank THREE
The rank THREE (3)


FOUR

public static final Rank FOUR
The rank FOUR (4)


FIVE

public static final Rank FIVE
The rank FIVE (5)


SIX

public static final Rank SIX
The rank SIX (6)


SEVEN

public static final Rank SEVEN
The rank SEVEN (7)


EIGHT

public static final Rank EIGHT
The rank EIGHT (8)


NINE

public static final Rank NINE
The rank NINE (9)


TEN

public static final Rank TEN
The rank TEN (10)


JACK

public static final Rank JACK
The rank JACK


QUEEN

public static final Rank QUEEN
The rank QUEEN


KING

public static final Rank KING
The rank KING

Method Detail

values

public static Rank[] 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 (Rank c : Rank.values())
    System.out.println(c);

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

valueOf

public static Rank 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 rank (e.g. ACE → 'a').

Returns:
the symbol

getName

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

Returns:
the name