Package adql.query

Class TextPosition


  • public class TextPosition
    extends java.lang.Object
    Indicates a simple position or a token/string position in a text. It is particularly used to localize columns and tables in the original ADQL query.
    Version:
    1.4 (06/2015)
    Author:
    Grégory Mantelet (CDS;ARI)
    • Constructor Summary

      Constructors 
      Constructor Description
      TextPosition()
      Build an unknown position (all fields = -1).
      TextPosition​(int line, int column)
      Builds a position whose the end line and column are unknown => a simple position.
      TextPosition​(int beginLine, int beginColumn, int endLine, int endColumn)
      Builds a position => a full position (a region in the text).
      TextPosition​(Token token)
      Builds a position defining the region delimited by the given token.
      TextPosition​(Token beginToken, Token endToken)
      Builds a position => a full position (a region in the text).
      TextPosition​(TextPosition positionToCopy)
      Builds a copy of the given position.
      TextPosition​(TextPosition startPos, TextPosition endPos)
      Builds a position whose the start is the start position of the first parameter and the end is the end position of the second parameter.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • beginLine

        public final int beginLine
      • beginColumn

        public final int beginColumn
      • endLine

        public final int endLine
      • endColumn

        public final int endColumn
    • Constructor Detail

      • TextPosition

        public TextPosition()
        Build an unknown position (all fields = -1).
      • TextPosition

        public TextPosition​(int line,
                            int column)
        Builds a position whose the end line and column are unknown => a simple position.
        Parameters:
        line - Begin line.
        column - Begin column.
      • TextPosition

        public TextPosition​(int beginLine,
                            int beginColumn,
                            int endLine,
                            int endColumn)
        Builds a position => a full position (a region in the text).
        Parameters:
        beginLine - Begin line.
        beginColumn - Begin column.
        endLine - End line.
        endColumn - End column.
      • TextPosition

        public TextPosition​(Token token)
        Builds a position defining the region delimited by the given token.
        Parameters:
        token - The position will be the one of this token.
      • TextPosition

        public TextPosition​(Token beginToken,
                            Token endToken)
        Builds a position => a full position (a region in the text).
        Parameters:
        beginToken - Begin position.
        endToken - End position.
      • TextPosition

        public TextPosition​(TextPosition positionToCopy)
        Builds a copy of the given position.
        Parameters:
        positionToCopy - Position to copy.
        Since:
        1.4
      • TextPosition

        public TextPosition​(TextPosition startPos,
                            TextPosition endPos)
        Builds a position whose the start is the start position of the first parameter and the end is the end position of the second parameter.
        Parameters:
        startPos - Start position (only beginLine and beginColumn will be used).
        endPos - End position (only endLine and endColumn will be used).
        Since:
        1.4
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object