Class LocationVal

All Implemented Interfaces:
HostResult

public class LocationVal extends Val
A location in a program.
  • Method Details

    • programName

      public String programName()
      Returns the program name.
      Returns:
      the program name.
    • programText

      public String programText()
      Returns the program text.
      Returns:
      the program text.
    • charPos

      public int charPos()
      Returns the char index of the pos.
      Returns:
      the char index of the pos.
    • runePos

      public int runePos()
      Returns the rune index of the pos.
      Returns:
      the rune index of the pos.
    • lineNum

      public int lineNum()
      Returns the one-based line number of the location on the program text.
      Returns:
      the one-based line number of the location on the program text.
    • columnCharOffset

      public int columnCharOffset()
      Returns the char offset from the head of the line.
      Returns:
      the char offset from the head of the line.
    • columnRuneOffset

      public int columnRuneOffset()
      Returns the rune offset from the head of the line.
      Returns:
      the rune offset from the head of the line.
    • line

      public String line()
      Returns the line string where the loc is located.
      Returns:
      the line string where the loc is located.
    • indicator

      public String indicator()
      Returns the string of Trace.indicator. The example result: "foo(-->bar)".
      Returns:
      the string of Trace.indicator.
    • desc

      public String desc()
      Returns the string of Trace.desc. The example result: "foo.kn L10 C15".
      Returns:
      the string of Trace.desc.
    • toString

      public String toString()
      Returns the string representation of the location val.
      Overrides:
      toString in class Object
      Returns:
      the string representation of the location val.
    • hashCode

      public int hashCode()
      Returns the hash code of the loction val.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code of the location val.
    • equals

      public boolean equals(Object arg)
      Returns true if the two locations have the same vms, program names, program texts and pos indices.
      Overrides:
      equals in class Object
      Parameters:
      arg - the argument to compare to.
      Returns:
      true if the two locations are equal.