Class ErrorLocation

java.lang.Object
net.orbyfied.j8.command.exception.ErrorLocation

public class ErrorLocation extends Object
The location of an error in a string.
  • Field Details

    • reader

      protected net.orbyfied.j8.util.StringReader reader
      The string (reader).
    • fromIndex

      protected int fromIndex
      The start index.
    • toIndex

      protected int toIndex
      The end index.
  • Constructor Details

    • ErrorLocation

      public ErrorLocation(net.orbyfied.j8.util.StringReader reader, int fromIndex, int toIndex)
      Constructor.
      Parameters:
      reader - The string reader.
      fromIndex - The start of the problematic segment.
      toIndex - The end of the problematic segment.
  • Method Details

    • getStartIndex

      public int getStartIndex()
    • getEndIndex

      public int getEndIndex()
    • getReader

      public net.orbyfied.j8.util.StringReader getReader()
    • getLocationString

      public String getLocationString()
      See Also:
    • getLocationString

      public String getLocationString(int prevStart, int prevEnd)
      Create a nicely formatted error location string.
      Parameters:
      prevStart - The preview length on the start.
      prevEnd - The preview length on the end.
      Returns:
      The string. TODO: change to components with j8-message api