Class LocationVal

All Implemented Interfaces:
HostResult

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

    • getProgramName

      public String getProgramName()
      Returns the program name.
      Returns:
      the program name.
    • getProgramText

      public String getProgramText()
      Returns the program text.
      Returns:
      the program text.
    • getCharPos

      public int getCharPos()
      Returns the char index of the pos.
      Returns:
      the char index of the pos.
    • getRunePos

      public int getRunePos()
      Returns the rune index of the pos.
      Returns:
      the rune index of the pos.
    • getLineNum

      public int getLineNum()
      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.
    • getColumnCharOffset

      public int getColumnCharOffset()
      Returns the char offset from the head of the line.
      Returns:
      the char offset from the head of the line.
    • getColumnRuneOffset

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

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

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

      public String getDesc()
      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.