Enum Constant.Condition

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

public static enum Constant.Condition
extends java.lang.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.

  • Nested Class Summary

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

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

    Enum Constants
    Enum Constant Description
    GREATER_THAN_OR_EQUAL_TO_ZERO
    Match >= operators and < instructions, equivalent to LESS_THAN_ZERO x >= 0
    GREATER_THAN_ZERO
    Match > operators and <= instructions, equivalent to LESS_THAN_OR_EQUAL_TO_ZERO x > 0
    LESS_THAN_OR_EQUAL_TO_ZERO
    Match <= operators and > instructions x <= 0
    LESS_THAN_ZERO
    Match < operators and >= instructions: x < 0
  • Method Summary

    Modifier and Type Method Description
    Constant.Condition getEquivalentCondition()
    Get the condition which is equivalent to this condition
    int[] getOpcodes()
    Get the opcodes for this condition
    static Constant.Condition valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static Constant.Condition[] 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, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 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 Constant.Condition 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
    • getEquivalentCondition

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

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