public class SqlParserPos
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
private static class |
SqlParserPos.QuotedParserPos
Parser position for an identifier segment that is quoted.
|
Modifier and Type | Field and Description |
---|---|
private int |
columnNumber |
private int |
endColumnNumber |
private int |
endLineNumber |
private int |
lineNumber |
static SqlParserPos |
QUOTED_ZERO
Same as
ZERO but always quoted. |
private static long |
serialVersionUID |
static SqlParserPos |
ZERO
SqlParserPos representing line one, character one.
|
Constructor and Description |
---|
SqlParserPos(int lineNumber,
int columnNumber)
Creates a new parser position.
|
SqlParserPos(int startLineNumber,
int startColumnNumber,
int endLineNumber,
int endColumnNumber)
Creates a new parser range.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
endsAfter(SqlParserPos pos) |
boolean |
equals(java.lang.Object o) |
int |
getColumnNum() |
int |
getEndColumnNum() |
int |
getEndLineNum() |
int |
getLineNum() |
int |
hashCode() |
boolean |
isQuoted() |
boolean |
overlaps(SqlParserPos pos) |
SqlParserPos |
plus(SqlParserPos pos)
Combines this parser position with another to create a
position that spans from the first point in the first to the last point
in the other.
|
SqlParserPos |
plusAll(java.util.Collection<SqlNode> nodeList)
Combines this parser position with a list of positions.
|
SqlParserPos |
plusAll(SqlNode[] nodes)
Combines this parser position with an array of positions to create a
position that spans from the first point in the first to the last point
in the other.
|
boolean |
startsAt(SqlParserPos pos) |
private boolean |
startsBefore(SqlParserPos pos) |
private static SqlParserPos |
sum_(java.util.List<SqlParserPos> positions)
Combines a list of parser positions to create a position which spans
from the beginning of the first to the end of the last.
|
static SqlParserPos |
sum(java.lang.Iterable<SqlParserPos> poses)
Combines an iterable of parser positions to create a position which spans
from the beginning of the first to the end of the last.
|
private static SqlParserPos |
sum(java.lang.Iterable<SqlParserPos> poses,
int line,
int column,
int endLine,
int endColumn)
Computes the parser position which is the sum of an array of parser
positions and of a parser position represented by (line, column, endLine,
endColumn).
|
static SqlParserPos |
sum(java.util.List<? extends SqlNode> nodes)
Combines the parser positions of a list of nodes to create a position
which spans from the beginning of the first to the end of the last.
|
static SqlParserPos |
sum(SqlNode[] nodes)
Combines the parser positions of an array of nodes to create a position
which spans from the beginning of the first to the end of the last.
|
private static java.lang.Iterable<SqlParserPos> |
toPos(java.lang.Iterable<SqlNode> nodes) |
private static java.util.List<SqlParserPos> |
toPos(SqlNode[] nodes) |
java.lang.String |
toString() |
SqlParserPos |
withQuoting(boolean quoted)
Returns a
SqlParserPos the same as this but quoted. |
public static final SqlParserPos ZERO
public static final SqlParserPos QUOTED_ZERO
ZERO
but always quoted.private static final long serialVersionUID
private final int lineNumber
private final int columnNumber
private final int endLineNumber
private final int endColumnNumber
public SqlParserPos(int lineNumber, int columnNumber)
public SqlParserPos(int startLineNumber, int startColumnNumber, int endLineNumber, int endColumnNumber)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int getLineNum()
public int getColumnNum()
public int getEndLineNum()
public int getEndColumnNum()
public SqlParserPos withQuoting(boolean quoted)
SqlParserPos
the same as this but quoted.public boolean isQuoted()
public java.lang.String toString()
toString
in class java.lang.Object
public SqlParserPos plus(SqlParserPos pos)
public SqlParserPos plusAll(SqlNode[] nodes)
public SqlParserPos plusAll(java.util.Collection<SqlNode> nodeList)
public static SqlParserPos sum(SqlNode[] nodes)
private static java.util.List<SqlParserPos> toPos(SqlNode[] nodes)
private static java.lang.Iterable<SqlParserPos> toPos(java.lang.Iterable<SqlNode> nodes)
public static SqlParserPos sum(java.util.List<? extends SqlNode> nodes)
public static SqlParserPos sum(java.lang.Iterable<SqlParserPos> poses)
private static SqlParserPos sum_(java.util.List<SqlParserPos> positions)
private static SqlParserPos sum(java.lang.Iterable<SqlParserPos> poses, int line, int column, int endLine, int endColumn)
poses
- Array of parser positionsline
- Start linecolumn
- Start columnendLine
- End lineendColumn
- End columnpublic boolean overlaps(SqlParserPos pos)
private boolean startsBefore(SqlParserPos pos)
private boolean endsAfter(SqlParserPos pos)
public boolean startsAt(SqlParserPos pos)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.