Enum Class Rank

java.lang.Object
java.lang.Enum<Rank>
cz.matfyz.rudad.joker.card.Rank
All Implemented Interfaces:
Serializable, Comparable<Rank>, Constable

public enum Rank extends Enum<Rank>
Represents the ranks of a card in a deck.
  • Enum Constant Details

    • TWO

      public static final Rank TWO
    • THREE

      public static final Rank THREE
    • FOUR

      public static final Rank FOUR
    • FIVE

      public static final Rank FIVE
    • SIX

      public static final Rank SIX
    • SEVEN

      public static final Rank SEVEN
    • EIGHT

      public static final Rank EIGHT
    • NINE

      public static final Rank NINE
    • TEN

      public static final Rank TEN
    • JACK

      public static final Rank JACK
    • QUEEN

      public static final Rank QUEEN
    • KING

      public static final Rank KING
    • ACE

      public static final Rank ACE
  • Method Details

    • values

      public static Rank[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Rank valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • fromAlias

      public static Rank fromAlias(char alias) throws IllegalArgumentException
      Returns the Rank corresponding to the given alias.
      Parameters:
      alias - the character alias to look up
      Returns:
      the Rank associated with the alias
      Throws:
      IllegalArgumentException - if the alias is invalid
    • fromAlias

      public static Rank fromAlias(String alias) throws IllegalArgumentException
      Returns the Rank corresponding to the given alias.
      Parameters:
      alias - the string alias to look up
      Returns:
      the Rank associated with the alias
      Throws:
      IllegalArgumentException - if the alias is invalid
    • getAlias

      public char getAlias()
      Returns the character alias of the rank.
      Returns:
      the character alias
    • toString

      public String toString()
      Returns the string representation of the rank.
      Overrides:
      toString in class Enum<Rank>
      Returns:
      the string representation