Enum At.Shift
- java.lang.Object
-
- java.lang.Enum<At.Shift>
-
- org.spongepowered.asm.mixin.injection.At.Shift
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<At.Shift>
- Enclosing class:
- At
public static enum At.Shift extends java.lang.Enum<At.Shift>
An enumeration defining the available modes of shifting as consumed byAt.shift().
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AFTERUse the instruction that is immediately after the instruction selected by the injection point selector defined byAt.value()(with the corresponding injection point constraints).BEFOREUse the instruction that is immediately before the instruction selected by the injection point selector defined byAt.value()(with the corresponding injection point constraints).BYUse an instruction that is immediately before n instructions after the instruction selected by the injection point selector defined byAt.value()(with the corresponding injection point constraints) ifAt.by()is a positive value, otherwise select the instruction immediately before n instructions before the instruction selected by the injection point selector, with n being the absolute value ofAt.by().NONENo shift.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static At.ShiftvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static At.Shift[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NONE
public static final At.Shift NONE
No shift. The instruction defined by the injection point selector of theAtwill be used as-is.
-
BEFORE
public static final At.Shift BEFORE
Use the instruction that is immediately before the instruction selected by the injection point selector defined byAt.value()(with the corresponding injection point constraints).
-
AFTER
public static final At.Shift AFTER
Use the instruction that is immediately after the instruction selected by the injection point selector defined byAt.value()(with the corresponding injection point constraints).
-
BY
public static final At.Shift BY
Use an instruction that is immediately before n instructions after the instruction selected by the injection point selector defined byAt.value()(with the corresponding injection point constraints) ifAt.by()is a positive value, otherwise select the instruction immediately before n instructions before the instruction selected by the injection point selector, with n being the absolute value ofAt.by().Simplified, using this
At.Shiftmode results in arbitrary shifts by n instructions (for n > 0, the shift is forwards while for n < 0 the shift is backwards. For n = 0 no shift occurs). This n is defined usingAt.by()(default value for that property is 0).Although permissible when using micromixin at this point in time, other mixin implementations (and potentially future iterations of micromixin) may produce warnings or application failures when using
BYin combination with aAt.by()that is a very large value. As a rule of thumb, anAt.by()smaller than -3 or larger than 3 are to be avoided. Reason for this is thatAt.by()is rather blind, enabling the possibility of writing injection points that are more unstable than they actually need to be.
-
-
Method Detail
-
values
public static At.Shift[] 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 (At.Shift c : At.Shift.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static At.Shift 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 namejava.lang.NullPointerException- if the argument is null
-
-