public class SqlNodeList extends SqlNode implements List<SqlNode>, RandomAccess
SqlNode.toList()| Modifier and Type | Field and Description |
|---|---|
static SqlNodeList |
EMPTY
An immutable, empty SqlNodeList.
|
static SqlNodeList |
SINGLETON_EMPTY
A SqlNodeList that has a single element that is an empty list.
|
static SqlNodeList |
SINGLETON_STAR
A SqlNodeList that has a single element that is a star identifier.
|
EMPTY_ARRAY, pos| Constructor and Description |
|---|
SqlNodeList(Collection<? extends SqlNode> collection,
SqlParserPos pos)
Creates a
SqlNodeList containing the nodes in
list. |
SqlNodeList(SqlParserPos pos)
Creates a SqlNodeList that is initially empty.
|
| Modifier and Type | Method and Description |
|---|---|
<R> R |
accept(SqlVisitor<R> visitor)
Accepts a generic visitor.
|
void |
add(int index,
@Nullable SqlNode element) |
boolean |
add(@Nullable SqlNode node) |
boolean |
addAll(Collection<? extends SqlNode> c) |
boolean |
addAll(int index,
Collection<? extends SqlNode> c) |
void |
clear() |
SqlNodeList |
clone(SqlParserPos pos)
Clones a SqlNode with a different position.
|
boolean |
contains(@Nullable Object o) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(@Nullable Object o) |
boolean |
equalsDeep(@Nullable SqlNode node,
Litmus litmus)
Returns whether this node is structurally equivalent to another node.
|
SqlNode |
get(int n) |
List<SqlNode> |
getList() |
int |
hashCode() |
int |
indexOf(@Nullable Object o) |
boolean |
isEmpty() |
static boolean |
isEmptyList(SqlNode node) |
Iterator<SqlNode> |
iterator() |
int |
lastIndexOf(@Nullable Object o) |
ListIterator<SqlNode> |
listIterator() |
ListIterator<SqlNode> |
listIterator(int index) |
static SqlNodeList |
of(SqlNode node1) |
static SqlNodeList |
of(SqlNode node1,
SqlNode node2) |
static SqlNodeList |
of(SqlNode node1,
SqlNode node2,
SqlNode... nodes) |
static SqlNodeList |
of(SqlParserPos pos,
List<SqlNode> list)
Creates a SqlNodeList with a given backing list.
|
SqlNode |
remove(int index) |
boolean |
remove(@Nullable Object o) |
boolean |
removeAll(Collection<?> c) |
boolean |
retainAll(Collection<?> c) |
SqlNode |
set(int n,
@Nullable SqlNode node) |
int |
size() |
List<SqlNode> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
void |
unparse(SqlWriter writer,
int leftPrec,
int rightPrec)
Writes a SQL representation of this node to a writer.
|
void |
validate(SqlValidator validator,
SqlValidatorScope scope)
Validates this node.
|
void |
validateExpr(SqlValidator validator,
SqlValidatorScope scope)
Validates this node in an expression context.
|
clone, clone, cloneArray, equalDeep, equalDeep, equalsDeep, findValidOptions, getKind, getMonotonicity, getParserPosition, isA, toList, toList, toSqlString, toSqlString, toSqlString, toString, unparseWithParenthesesfinalize, getClass, notify, notifyAll, wait, wait, waitreplaceAll, sort, spliteratorparallelStream, removeIf, streampublic static final SqlNodeList EMPTY
public static final SqlNodeList SINGLETON_EMPTY
public static final SqlNodeList SINGLETON_STAR
public SqlNodeList(SqlParserPos pos)
public SqlNodeList(Collection<? extends SqlNode> collection, SqlParserPos pos)
SqlNodeList containing the nodes in
list. The list is copied, but the nodes in it are not.public static SqlNodeList of(SqlParserPos pos, List<SqlNode> list)
public int hashCode()
public boolean equals(@Nullable Object o)
public boolean isEmpty()
public int size()
public ListIterator<SqlNode> listIterator()
listIterator in interface List<SqlNode>public ListIterator<SqlNode> listIterator(int index)
listIterator in interface List<SqlNode>public boolean contains(@Nullable Object o)
public boolean containsAll(Collection<?> c)
containsAll in interface Collection<SqlNode>containsAll in interface List<SqlNode>public int lastIndexOf(@Nullable Object o)
lastIndexOf in interface List<SqlNode>public Object[] toArray()
public <T> T[] toArray(T[] a)
public boolean add(@Nullable SqlNode node)
public void add(int index,
@Nullable SqlNode element)
public boolean addAll(Collection<? extends SqlNode> c)
public boolean addAll(int index,
Collection<? extends SqlNode> c)
public void clear()
public boolean remove(@Nullable Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public SqlNodeList clone(SqlParserPos pos)
SqlNodepublic void unparse(SqlWriter writer, int leftPrec, int rightPrec)
SqlNodeThe leftPrec and rightPrec parameters give
us enough context to decide whether we need to enclose the expression in
parentheses. For example, we need parentheses around "2 + 3" if preceded
by "5 *". This is because the precedence of the "*" operator is greater
than the precedence of the "+" operator.
The algorithm handles left- and right-associative operators by giving them slightly different left- and right-precedence.
If SqlWriter.isAlwaysUseParentheses() is true, we use
parentheses even when they are not required by the precedence rules.
For the details of this algorithm, see SqlCall.unparse(org.apache.calcite.sql.SqlWriter, int, int).
public void validate(SqlValidator validator, SqlValidatorScope scope)
SqlNodeThe typical implementation of this method will make a callback to the
validator appropriate to the node type and context. The validator has
methods such as SqlValidator.validateLiteral(org.apache.calcite.sql.SqlLiteral) for these purposes.
public <R> R accept(SqlVisitor<R> visitor)
SqlNodeImplementations of this method in subtypes simply call the appropriate
visit method on the
visitor object.
The type parameter R must be consistent with the type
parameter of the visitor.
public boolean equalsDeep(@Nullable SqlNode node, Litmus litmus)
SqlNodeequalsDeep in class SqlNodepublic static boolean isEmptyList(SqlNode node)
public static SqlNodeList of(SqlNode node1)
public static SqlNodeList of(SqlNode node1, SqlNode node2)
public static SqlNodeList of(SqlNode node1, SqlNode node2, SqlNode... nodes)
public void validateExpr(SqlValidator validator, SqlValidatorScope scope)
SqlNodeUsually, this method does much the same as SqlNode.validate(org.apache.calcite.sql.validate.SqlValidator, org.apache.calcite.sql.validate.SqlValidatorScope), but a
SqlIdentifier can occur in expression and non-expression
contexts.
validateExpr in class SqlNodeCopyright © 2012-2022 Apache Software Foundation. All Rights Reserved.