Class Position

java.lang.Object
ortus.boxlang.compiler.ast.Position
All Implemented Interfaces:
Serializable

public class Position extends Object implements Serializable
Represents a region of code within a text
See Also:
  • Constructor Details

    • Position

      public Position(Point start, Point end)
      Creates a position
      Parameters:
      start - the start position in the source code
      end - the end position in the source code
    • Position

      public Position(Point start, Point end, Source source)
      Creates a position including the file information
      Parameters:
      start - the start position in the source code
      end - the end position in the source code
      source - the source file reference
  • Method Details

    • getStart

      public Point getStart()
      Returns the start point
      Returns:
      the start point of the region
    • getEnd

      public Point getEnd()
      Returns the end point
      Returns:
      the end point of the region
    • setEnd

      public void setEnd(Point end)
      Set the end point
      Parameters:
      end - the end point of the region
    • setStart

      public void setStart(Point start)
      Set the end point
      Parameters:
      start - the end point of the region
    • getSource

      public Source getSource()
      Returns the source of the position
      Returns:
      the start point of the region
      See Also:
    • setSource

      public void setSource(Source source)
      Set the source of the position
      Parameters:
      source - The source of the position (i.e. file)
      See Also:
    • toString

      public String toString()
      String representation of the Position
      Overrides:
      toString in class Object
      Returns:
      a String representation of the position including the source file if available
    • toMap

      public Map<String,Object> toMap()