java.lang.Object
org.spongepowered.asm.mixin.transformer.struct.InsnRange

public class InsnRange extends Object
Struct for representing a range of instructions
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final int
    End of the range (line number)
    final int
    Range marker (index of insn)
    final int
    Start of the range (line number)
  • Constructor Summary

    Constructors
    Constructor
    Description
    InsnRange(int start, int end, int marker)
    Create a range with the specified values.
  • Method Summary

    Modifier and Type
    Method
    Description
    Deque<org.objectweb.asm.tree.AbstractInsnNode>
    apply(org.objectweb.asm.tree.InsnList insns, boolean inclusive)
    Apply this range to the specified insn list
    boolean
    contains(int value)
    Returns true if the supplied value is between or equal to start and end
    boolean
    excludes(int value)
    Returns true if the supplied value is outside the range
    boolean
    Range is valid if both start and end are nonzero and end is after or at start
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • start

      public final int start
      Start of the range (line number)
    • end

      public final int end
      End of the range (line number)
    • marker

      public final int marker
      Range 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 range
      end - End of the range
      marker - 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

      public String toString()
      Overrides:
      toString in class Object
    • 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 filter
      inclusive - whether to include or exclude instructions
      Returns:
      filtered list