Skip to content

Record Class Location

Javadoc 27 generates this reference during each site build from the exported packages and the annotation processor. The Java guide shows the API in use.

java.lang.Object
java.lang.Record
dev.gecode.iris.Location
Record Components:
origin - the name of the source, or null if it has none
line - the line, or null if not reported
column - the column in bytes, or null if not reported
All Implemented Interfaces:
Serializable
public record Location(@Nullable String origin, @Nullable Integer line, @Nullable Integer column) extends Record implements Serializable
A position in a reader spec or an input.

Lines and columns count from 1. A part that an error does not report is null: reader-spec errors usually have a line and no column, and some errors name only the origin.

  • Constructor Details

    • Location

      public Location(@Nullable String origin, @Nullable Integer line, @Nullable Integer column)
      Creates an instance of a Location record class.
      Parameters:
      origin - the value for the origin record component
      line - the value for the line record component
      column - the value for the column record component
  • Method Details

    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • origin

      public @Nullable String origin()
      Returns the value of the origin record component.
      Returns:
      the value of the origin record component
    • line

      public @Nullable Integer line()
      Returns the value of the line record component.
      Returns:
      the value of the line record component
    • column

      public @Nullable Integer column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component