Class InstructionSlot<T extends Instruction>

java.lang.Object
net.covers1624.coffeegrinder.bytecode.InstructionSlot<T>
Direct Known Subclasses:
InstructionCollection, InstructionCollection.CollectionSlot

public class InstructionSlot<T extends Instruction> extends Object
Represents a Slot to hold an Instruction.

Created by covers1624 on 21/9/21.

  • Constructor Details

    • InstructionSlot

      public InstructionSlot(Instruction parent)
      Create a new InstructionSlot.
      Parameters:
      parent - The parent owning instruction.
    • InstructionSlot

      protected InstructionSlot(Instruction parent, boolean link)
  • Method Details

    • set

      public void set(Instruction value)
      Set the value in this slot.
      Parameters:
      value - The value.
    • getValueOrNull

      @Nullable public T getValueOrNull()
      Return the value stored inside the slot.
      Returns:
      The value, otherwise null
    • get

      public T get()
      Return the value stored inside the slot.
      Returns:
      The value.
    • checkInvariant

      protected void checkInvariant()