Class InjectionNodes

java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<InjectionNodes.InjectionNode>
org.spongepowered.asm.mixin.injection.struct.InjectionNodes
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<InjectionNodes.InjectionNode>, java.util.Collection<InjectionNodes.InjectionNode>, java.util.List<InjectionNodes.InjectionNode>, java.util.RandomAccess

public class InjectionNodes
extends java.util.ArrayList<InjectionNodes.InjectionNode>
Used to keep track of instruction nodes in a Target method which are targetted by various types of injector. This collection is populated during the first injector pass and allows injectors to keep track of their targets even when the target method is being manipulated by other injectors.
See Also:
Serialized Form
  • Nested Class Summary

    Nested Classes
    Modifier and Type Class Description
    static class  InjectionNodes.InjectionNode
    A node targetted by one or more injectors.
  • Field Summary

    Fields inherited from class java.util.AbstractList

    modCount
  • Constructor Summary

    Constructors
    Constructor Description
    InjectionNodes()  
  • Method Summary

    Modifier and Type Method Description
    InjectionNodes.InjectionNode add​(org.objectweb.asm.tree.AbstractInsnNode node)
    Add a tracked node to this collection if it does not already exist
    boolean contains​(org.objectweb.asm.tree.AbstractInsnNode node)
    Get whether this collection contains a mapping for the specified insn
    InjectionNodes.InjectionNode get​(org.objectweb.asm.tree.AbstractInsnNode node)
    Get a tracked node from this collection if it already exists, returns null if the node is not tracked
    void remove​(org.objectweb.asm.tree.AbstractInsnNode node)
    Mark the specified node as removed, does not update the wrapper if no wrapper exists
    void replace​(org.objectweb.asm.tree.AbstractInsnNode oldNode, org.objectweb.asm.tree.AbstractInsnNode newNode)
    Replace the specified node with the new node, does not update the wrapper if no wrapper exists for oldNode

    Methods inherited from class java.util.ArrayList

    add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize

    Methods inherited from class java.util.AbstractCollection

    containsAll, toString

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Collection

    parallelStream, stream, toArray

    Methods inherited from interface java.util.List

    containsAll
  • Constructor Details

    • InjectionNodes

      public InjectionNodes()
  • Method Details

    • add

      public InjectionNodes.InjectionNode add​(org.objectweb.asm.tree.AbstractInsnNode node)
      Add a tracked node to this collection if it does not already exist
      Parameters:
      node - Instruction node to add
      Returns:
      wrapper for the specified node
    • get

      public InjectionNodes.InjectionNode get​(org.objectweb.asm.tree.AbstractInsnNode node)
      Get a tracked node from this collection if it already exists, returns null if the node is not tracked
      Parameters:
      node - instruction node
      Returns:
      wrapper node or null if not tracked
    • contains

      public boolean contains​(org.objectweb.asm.tree.AbstractInsnNode node)
      Get whether this collection contains a mapping for the specified insn
      Parameters:
      node - instruction node to check
      Returns:
      true if a wrapper exists for the node
    • replace

      public void replace​(org.objectweb.asm.tree.AbstractInsnNode oldNode, org.objectweb.asm.tree.AbstractInsnNode newNode)
      Replace the specified node with the new node, does not update the wrapper if no wrapper exists for oldNode
      Parameters:
      oldNode - node being replaced
      newNode - node to replace with
    • remove

      public void remove​(org.objectweb.asm.tree.AbstractInsnNode node)
      Mark the specified node as removed, does not update the wrapper if no wrapper exists
      Parameters:
      node - node being removed