Enum Operation

  • All Implemented Interfaces:
    java.io.Serializable , kotlin.Comparable

    
    public enum Operation
    extends Enum<Operation>
                        

    Represents an operation (+=, -=), and allows you to calculate the result from two floats.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public class Operation.Companion
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ADD

      Represents the addition operation: a + b.

      SUBTRACT

      Represents the subtraction operation: a - b.

      MULTIPLY

      Represents the multiplication operation: a * b.

      DIVIDE

      Represents the division operation, a / b.

      MODULO

      Represents the modulo operation: a % b.

      ASSIGN

      Represents the assignment operation, which in this case is the same as SWAP: a = b.

      LOWEST_VALUE

      Returns the lowest value of the two: min(a, b).

      MAXIMUM_VALUE

      Returns the highest value of the two: max(a, b).

      SWAP

      Represents the swapping operation, which in this case is the same as ASSIGN: a = b.

    • Method Summary

      Modifier and Type Method Description
      final Float apply(Float a, Float b) Returns the calculated number respective to the operation from two floats: a and b.
      final Float apply(Integer a, Integer b) Returns the calculated number respective to the operation from two ints: a and b.
      final Operation valueOf(String value) Returns the enum constant of this type with the specified name.
      final Array<Operation> values() Returns an array containing the constants of this enum type, in the order they're declared.
      final String getString()
      final EnumEntries<Operation> getEntries() Represents an operation (+=, -=), and allows you to calculate the result from two floats.
      • Methods inherited from class kotlin.Enum

        getName, getOrdinal
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • apply

         final Float apply(Float a, Float b)

        Returns the calculated number respective to the operation from two floats: a and b.

      • apply

         final Float apply(Integer a, Integer b)

        Returns the calculated number respective to the operation from two ints: a and b.

      • valueOf

         final Operation valueOf(String value)

        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:
        value - Represents the operation in string form, e.g.
      • values

         final Array<Operation> 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.