p2Util
Class Rank

java.lang.Object
  extended by p2Util.Rank

public class Rank
extends java.lang.Object

The Rank class defines each of the 13 ranks of a standard deck of playing cards. Using this class 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.

Class Invariant:
The Rank's symbol is a single alpha-numeric character
The Ranks's name is a non-empty string
14 <= Rank's value <= 2 and unique
Rank objects are immutable and unique

Author:
Dennis Frey

Method Summary
static Rank[] VALUES()
          A static method to return all ranks in an array
The array contains Ranks in order Ace, 2, 3,...,Queen, King
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

VALUES

public static Rank[] VALUES()
A static method to return all ranks in an array
The array contains Ranks in order Ace, 2, 3,...,Queen, King

Returns:
an array of Rank objects suitable for project 2