Class FilePosition

    • Method Detail

      • from

        public static FilePosition from​(int line)
        Create a new FilePosition using the supplied line number and an undefined column number.
        Parameters:
        line - the line number; must be greater than zero
      • from

        public static FilePosition from​(int line,
                                        int column)
        Create a new FilePosition using the supplied line and column numbers.
        Parameters:
        line - the line number; must be greater than zero
        column - the column number; must be greater than zero
      • getLine

        public int getLine()
        Get the line number of this FilePosition.
        Returns:
        the line number
      • getColumn

        public Optional<Integer> getColumn()
        Get the column number of this FilePosition, if available.
        Returns:
        an Optional containing the column number; never null but potentially empty
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object