Record Class PythonBytecodeInstruction

java.lang.Object
java.lang.Record
ai.timefold.jpyinterpreter.PythonBytecodeInstruction

public record PythonBytecodeInstruction(String opname, int offset, int arg, String argRepr, OptionalInt startsLine, boolean isJumpTarget) extends Record
  • Constructor Details

    • PythonBytecodeInstruction

      public PythonBytecodeInstruction(String opname, int offset, int arg, String argRepr, OptionalInt startsLine, boolean isJumpTarget)
      Creates an instance of a PythonBytecodeInstruction record class.
      Parameters:
      opname - the value for the opname record component
      offset - the value for the offset record component
      arg - the value for the arg record component
      argRepr - the value for the argRepr record component
      startsLine - the value for the startsLine record component
      isJumpTarget - the value for the isJumpTarget record component
  • Method Details

    • atOffset

      public static PythonBytecodeInstruction atOffset(String opname, int offset)
    • atOffset

      public static PythonBytecodeInstruction atOffset(OpcodeDescriptor instruction, int offset)
    • withArg

      public PythonBytecodeInstruction withArg(int newArg)
    • withArgRepr

      public PythonBytecodeInstruction withArgRepr(String newArgRepr)
    • startsLine

      public PythonBytecodeInstruction startsLine(int lineNumber)
    • withIsJumpTarget

      public PythonBytecodeInstruction withIsJumpTarget(boolean isJumpTarget)
    • markAsJumpTarget

      public PythonBytecodeInstruction markAsJumpTarget()
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • opname

      public String opname()
      Returns the value of the opname record component.
      Returns:
      the value of the opname record component
    • offset

      public int offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component
    • arg

      public int arg()
      Returns the value of the arg record component.
      Returns:
      the value of the arg record component
    • argRepr

      public String argRepr()
      Returns the value of the argRepr record component.
      Returns:
      the value of the argRepr record component
    • startsLine

      public OptionalInt startsLine()
      Returns the value of the startsLine record component.
      Returns:
      the value of the startsLine record component
    • isJumpTarget

      public boolean isJumpTarget()
      Returns the value of the isJumpTarget record component.
      Returns:
      the value of the isJumpTarget record component