Enum PowerUpOperation

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<PowerUpOperation>

    public enum PowerUpOperation
    extends java.lang.Enum<PowerUpOperation>
    // Assessment 2 addition // For PowerUp requirement
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      decrement
      Decrement the key value by an amount.
      divide
      Divide the key value by an amount.
      increment
      Increment the key value by an amount.
      multiply
      Multiply the key value by an amount.
      replace
      Replace the key value with a new value.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static PowerUpOperation valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static PowerUpOperation[] 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, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

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

      • replace

        public static final PowerUpOperation replace
        Replace the key value with a new value.
      • increment

        public static final PowerUpOperation increment
        Increment the key value by an amount.
      • decrement

        public static final PowerUpOperation decrement
        Decrement the key value by an amount.
      • multiply

        public static final PowerUpOperation multiply
        Multiply the key value by an amount.
      • divide

        public static final PowerUpOperation divide
        Divide the key value by an amount.
    • Method Detail

      • values

        public static PowerUpOperation[] 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 (PowerUpOperation c : PowerUpOperation.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static PowerUpOperation 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