Class InsnRange
java.lang.Object
org.spongepowered.asm.mixin.transformer.struct.InsnRange
Struct for representing a range of instructions
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInsnRange
(int start, int end, int marker) Create a range with the specified values. -
Method Summary
Modifier and TypeMethodDescriptionDeque
<org.objectweb.asm.tree.AbstractInsnNode> apply
(org.objectweb.asm.tree.InsnList insns, boolean inclusive) Apply this range to the specified insn listboolean
contains
(int value) Returns true if the supplied value is between or equal to start and endboolean
excludes
(int value) Returns true if the supplied value is outside the rangeboolean
isValid()
Range is valid if both start and end are nonzero and end is after or at starttoString()
-
Field Details
-
start
public final int startStart of the range (line number) -
end
public final int endEnd of the range (line number) -
marker
public final int markerRange marker (index of insn)
-
-
Constructor Details
-
InsnRange
public InsnRange(int start, int end, int marker) Create a range with the specified values.- Parameters:
start
- Start of the rangeend
- End of the rangemarker
- Arbitrary marker value
-
-
Method Details
-
isValid
public boolean isValid()Range is valid if both start and end are nonzero and end is after or at start- Returns:
- true if valid
-
contains
public boolean contains(int value) Returns true if the supplied value is between or equal to start and end- Parameters:
value
- true if the range contains value
-
excludes
public boolean excludes(int value) Returns true if the supplied value is outside the range- Parameters:
value
- true if the range does not contain value
-
toString
-
apply
public Deque<org.objectweb.asm.tree.AbstractInsnNode> apply(org.objectweb.asm.tree.InsnList insns, boolean inclusive) Apply this range to the specified insn list- Parameters:
insns
- insn list to filterinclusive
- whether to include or exclude instructions- Returns:
- filtered list
-