Record Class FieldTarget

java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase7.support.FieldTarget
Record Components:
objectVar - the object (often this)
fieldName - the field's name
ownerType - the fully qualified type that owns the field
fieldType - the fully qualified type of the field
fieldIndex - the field's index, or OwnershipInstr.NO_FIELD_INDEX

public record FieldTarget(String objectVar, String fieldName, String ownerType, String fieldType, int fieldIndex) extends Record
A field as STORE_FIELD describes it - the object, the field's name, the type that owns it, the field's type and its index (or OwnershipInstr.NO_FIELD_INDEX where STORE_FIELD looks it up by name). What VariableMemoryManagement.fieldAssigned(FieldTarget, String, OwnershipInstr.AssignMode, boolean, DebugInfo) stores into.
  • Constructor Details

    • FieldTarget

      public FieldTarget(String objectVar, String fieldName, String ownerType, String fieldType, int fieldIndex)
      Creates an instance of a FieldTarget record class.
      Parameters:
      objectVar - the value for the objectVar record component
      fieldName - the value for the fieldName record component
      ownerType - the value for the ownerType record component
      fieldType - the value for the fieldType record component
      fieldIndex - the value for the fieldIndex record component
  • Method Details

    • byName

      public static FieldTarget byName(String objectVar, String fieldName, String ownerType, String fieldType)
      A field stored by name, without an index.
    • 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.
    • objectVar

      public String objectVar()
      Returns the value of the objectVar record component.
      Returns:
      the value of the objectVar record component
    • fieldName

      public String fieldName()
      Returns the value of the fieldName record component.
      Returns:
      the value of the fieldName record component
    • ownerType

      public String ownerType()
      Returns the value of the ownerType record component.
      Returns:
      the value of the ownerType record component
    • fieldType

      public String fieldType()
      Returns the value of the fieldType record component.
      Returns:
      the value of the fieldType record component
    • fieldIndex

      public int fieldIndex()
      Returns the value of the fieldIndex record component.
      Returns:
      the value of the fieldIndex record component