Enum Class Constant.Condition

java.lang.Object
java.lang.Enum<Constant.Condition>
org.spongepowered.asm.mixin.injection.Constant.Condition
All Implemented Interfaces:
Serializable, Comparable<Constant.Condition>, Constable
Enclosing class:
Constant

public static enum Constant.Condition extends Enum<Constant.Condition>
Available options for the Constant.expandZeroConditions() setting. Each option matches the inverse instructions as well because in the compiled code it is not unusual for if (x > 0) to be compiled as if (!(x <= 0))

Note that all of these options assume that x is on the left-hand side of the expression in question. For expressions where zero is on the right-hand side you should choose the inverse.

  • Enum Constant Details

    • LESS_THAN_ZERO

      public static final Constant.Condition LESS_THAN_ZERO
      Match < operators and >= instructions: x < 0
    • LESS_THAN_OR_EQUAL_TO_ZERO

      public static final Constant.Condition LESS_THAN_OR_EQUAL_TO_ZERO
      Match <= operators and > instructions x <= 0
    • GREATER_THAN_OR_EQUAL_TO_ZERO

      public static final Constant.Condition GREATER_THAN_OR_EQUAL_TO_ZERO
      Match >= operators and < instructions, equivalent to LESS_THAN_ZERO x >= 0
    • GREATER_THAN_ZERO

      public static final Constant.Condition GREATER_THAN_ZERO
      Match > operators and <= instructions, equivalent to LESS_THAN_OR_EQUAL_TO_ZERO x > 0
  • Method Details

    • values

      public static Constant.Condition[] 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 Constant.Condition 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
    • getEquivalentCondition

      public Constant.Condition getEquivalentCondition()
      Get the condition which is equivalent to this condition
    • getOpcodes

      public int[] getOpcodes()
      Get the opcodes for this condition