Record Class Trace

java.lang.Object
java.lang.Record
org.kink_lang.kink.internal.callstack.Trace
Record Components:
symHandle - the sym handle.
location - the location.
isTail - whether it is on the tail.

public record Trace(int symHandle, Location location, boolean isTail) extends Record
A trace of a call.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Trace
    The trace which represents snipping of traces; it has neither sym handle nor location.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Trace(int symHandle, Location location, boolean isTail)
    Constructs a trace.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the isTail record component.
    Returns the value of the location record component.
    static Trace
    of(int symHandle)
    Returns a trace frame with the sym handle.
    static Trace
    of(int symHandle, Location location)
    Returns a trace frame with the sym handle and the location, not on the tail.
    static Trace
    of(Location location)
    Returns a trace frame with the location.
    static Trace
    ofTail(int symHandle)
    Returns a trace of a taill call with the sym handle.
    Returns a trace on tail, with the same symHandle and location.
    int
    Returns the value of the symHandle record component.
    final String
    Returns a string representation of this record class.
    Returns the val representing the trace.

    Methods inherited from class java.lang.Object

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

    • SNIP

      public static final Trace SNIP
      The trace which represents snipping of traces; it has neither sym handle nor location.
  • Constructor Details

    • Trace

      public Trace(int symHandle, Location location, boolean isTail)
      Constructs a trace.
      Parameters:
      symHandle - the sym handle.
      location - the location.
      isTail - whether it is on the tail.
  • Method Details

    • of

      public static Trace of(int symHandle)
      Returns a trace frame with the sym handle.
      Parameters:
      symHandle - the sym handle.
      Returns:
      a trace frame with the sym handle.
    • ofTail

      public static Trace ofTail(int symHandle)
      Returns a trace of a taill call with the sym handle.
      Parameters:
      symHandle - the sym handle.
      Returns:
      a trace of a taill call with the sym handle.
    • of

      public static Trace of(Location location)
      Returns a trace frame with the location.
      Parameters:
      location - the location.
      Returns:
      a trace frame with the location.
    • of

      public static Trace of(int symHandle, Location location)
      Returns a trace frame with the sym handle and the location, not on the tail.
      Parameters:
      symHandle - the sym handle.
      location - the location.
      Returns:
      a trace frame with the sym handle and the location, not on the tail.
    • onTail

      public Trace onTail()
      Returns a trace on tail, with the same symHandle and location.
      Returns:
      a trace on tail, with the same symHandle and location.
    • toTraceVal

      public TraceVal toTraceVal(Vm vm)
      Returns the val representing the trace.
      Parameters:
      vm - the vm.
      Returns:
      the trace val.
    • toString

      public final 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.
    • symHandle

      public int symHandle()
      Returns the value of the symHandle record component.
      Returns:
      the value of the symHandle record component
    • location

      public Location location()
      Returns the value of the location record component.
      Returns:
      the value of the location record component
    • isTail

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