Enum Constant.Condition

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Constant.Condition>
    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.

    • Enum Constant Detail

      • 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
    • Method Detail

      • values

        public static Constant.Condition[] 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 (Constant.Condition c : Constant.Condition.values())
            System.out.println(c);
        
        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