Record Class ResourceCloser.Closing

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.generator.ResourceCloser.Closing
Record Components:
load - instructions that bring the value into variable (empty for a value already in a variable - a resource or a statement's owner temp; a property's LOAD_FIELD for the property chain). They run just before the value's own close, inside the region.
variable - the IR variable holding it
staticType - its static type
staticTypeName - the IR name of that type
debugInfo - where the close is attributed
Enclosing class:
ResourceCloser

public static record ResourceCloser.Closing(List<IRInstr> load, String variable, ISymbol staticType, String staticTypeName, DebugInfo debugInfo, boolean viaSuper) extends Record
A value to close.
  • Constructor Details

    • Closing

      public Closing(List<IRInstr> load, String variable, ISymbol staticType, String staticTypeName, DebugInfo debugInfo)
      A value brought into a variable by load (a property's LOAD_FIELD).
    • Closing

      public Closing(String variable, ISymbol staticType, String staticTypeName, DebugInfo debugInfo)
      A value already held in a variable.
    • Closing

      public Closing(List<IRInstr> load, String variable, ISymbol staticType, String staticTypeName, DebugInfo debugInfo, boolean viaSuper)
      Creates an instance of a Closing record class.
      Parameters:
      load - the value for the load record component
      variable - the value for the variable record component
      staticType - the value for the staticType record component
      staticTypeName - the value for the staticTypeName record component
      debugInfo - the value for the debugInfo record component
      viaSuper - the value for the viaSuper record component
  • Method Details

    • viaSuper

      public static ResourceCloser.Closing viaSuper(ISymbol superType, String superTypeName, DebugInfo debugInfo)
      The super class's close, called NON-virtually on this object (super._close()): the last step of a generated close chain. Never null-guarded - the object is there.
      Parameters:
      superType - the super class whose close (own or inherited from a class) is called
      superTypeName - its IR name
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • load

      public List<IRInstr> load()
      Returns the value of the load record component.
      Returns:
      the value of the load record component
    • variable

      public String variable()
      Returns the value of the variable record component.
      Returns:
      the value of the variable record component
    • staticType

      public ISymbol staticType()
      Returns the value of the staticType record component.
      Returns:
      the value of the staticType record component
    • staticTypeName

      public String staticTypeName()
      Returns the value of the staticTypeName record component.
      Returns:
      the value of the staticTypeName record component
    • debugInfo

      public DebugInfo debugInfo()
      Returns the value of the debugInfo record component.
      Returns:
      the value of the debugInfo record component
    • viaSuper

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