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 aTargetmethod 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 classInjectionNodes.InjectionNodeA node targetted by one or more injectors.
-
Constructor Summary
Constructors Constructor Description InjectionNodes()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InjectionNodes.InjectionNodeadd(org.objectweb.asm.tree.AbstractInsnNode node)Add a tracked node to this collection if it does not already existbooleancontains(org.objectweb.asm.tree.AbstractInsnNode node)Get whether this collection contains a mapping for the specified insnInjectionNodes.InjectionNodeget(org.objectweb.asm.tree.AbstractInsnNode node)Get a tracked node from this collection if it already exists, returns null if the node is not trackedInjectionNodes.InjectionNoderemove(org.objectweb.asm.tree.AbstractInsnNode node)Mark the specified node as removed, does not update the wrapper if no wrapper existsInjectionNodes.InjectionNodereplace(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
-
-
-
-
Method Detail
-
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 InjectionNodes.InjectionNode 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 replacednewNode- node to replace with
-
remove
public InjectionNodes.InjectionNode 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
-
-