Enum Value

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Value>, java.lang.constant.Constable

    public enum Value
    extends java.lang.Enum<Value>
    Defines the 13 card values from TWO to ACE.
    Since:
    17.08.2016 19:15:11
    Author:
    Nico Danneberg
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.lang.Enum

        java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private char text
      Stores the text representation as a single character.
      private int value
      Stores the numeric value of a value.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Value​(int val, char txt)
      Creates a new value with the given vaule and text by internal access only.
    • Method Summary

      Modifier and Type Method Description
      int getValue()
      Just a getter for the value
      java.lang.String toString()  
      static Value valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Value[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • TWO

        public static final Value TWO
        The 13 card values with both, a numeric value and a text representations.
      • THREE

        public static final Value THREE
      • FOUR

        public static final Value FOUR
      • FIFE

        public static final Value FIFE
      • SIX

        public static final Value SIX
      • SEVEN

        public static final Value SEVEN
      • EIGHT

        public static final Value EIGHT
      • NINE

        public static final Value NINE
      • TEN

        public static final Value TEN
      • JACK

        public static final Value JACK
      • QUEEN

        public static final Value QUEEN
      • KING

        public static final Value KING
      • ACE

        public static final Value ACE
    • Field Detail

      • value

        private int value
        Stores the numeric value of a value.
      • text

        private char text
        Stores the text representation as a single character.
    • Constructor Detail

      • Value

        private Value​(int val,
                      char txt)
        Creates a new value with the given vaule and text by internal access only.
        Parameters:
        val - the numeric value
        txt - the text representation
        See Also:
        value, text
    • Method Detail

      • values

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

        public static Value 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
      • getValue

        public int getValue()
        Just a getter for the value
        Returns:
        the numeric value
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<Value>