ca.ualberta.cs.poker.free.dynamics
Enum Card.Rank

java.lang.Object
  extended by java.lang.Enum<Card.Rank>
      extended by ca.ualberta.cs.poker.free.dynamics.Card.Rank
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Card.Rank>
Enclosing class:
Card

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

An enumeration class for Rank. It is unclear if there is a significant gain from this, and it may be deprecated in future versions.


Enum Constant Summary
ACE
           
EIGHT
           
FIVE
           
FOUR
           
JACK
           
KING
           
NINE
           
QUEEN
           
SEVEN
           
SIX
           
TEN
           
THREE
           
TWO
           
 
Field Summary
 int index
           
 char representation
           
 
Method Summary
static Card.Rank toRank(char c)
          toRank is implemented in a slow fashion: could be optimized.
 java.lang.String toString()
          A one character string representation.
static Card.Rank valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Card.Rank[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

TWO

public static final Card.Rank TWO

THREE

public static final Card.Rank THREE

FOUR

public static final Card.Rank FOUR

FIVE

public static final Card.Rank FIVE

SIX

public static final Card.Rank SIX

SEVEN

public static final Card.Rank SEVEN

EIGHT

public static final Card.Rank EIGHT

NINE

public static final Card.Rank NINE

TEN

public static final Card.Rank TEN

JACK

public static final Card.Rank JACK

QUEEN

public static final Card.Rank QUEEN

KING

public static final Card.Rank KING

ACE

public static final Card.Rank ACE
Field Detail

representation

public char representation

index

public int index
Method Detail

values

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

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

valueOf

public static Card.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

toString

public java.lang.String toString()
A one character string representation. 2-9,T,J,Q,K

Overrides:
toString in class java.lang.Enum<Card.Rank>

toRank

public static Card.Rank toRank(char c)
toRank is implemented in a slow fashion: could be optimized. returns 0-12