MCPcopy Create free account
hub / github.com/apache/calcite / indexOfDeep

Method indexOfDeep

core/src/main/java/org/apache/calcite/sql/SqlUtil.java:170–178  ·  view source on GitHub ↗

Finds the index of an expression in a list, comparing using SqlNode#equalsDeep(SqlNode, Litmus).

(List<? extends SqlNode> list, SqlNode e,
      Litmus litmus)

Source from the content-addressed store, hash-verified

168 /** Finds the index of an expression in a list, comparing using
169 * {@link SqlNode#equalsDeep(SqlNode, Litmus)}. */
170 public static int indexOfDeep(List<? extends SqlNode> list, SqlNode e,
171 Litmus litmus) {
172 for (int i = 0; i < list.size(); i++) {
173 if (e.equalsDeep(list.get(i), litmus)) {
174 return i;
175 }
176 }
177 return -1;
178 }
179
180 /**
181 * Returns whether a node represents the NULL value.

Callers 3

lookupGroupExprMethod · 0.95
isMeasureExprMethod · 0.95
lookupGroupingExprMethod · 0.95

Calls 3

sizeMethod · 0.65
getMethod · 0.65
equalsDeepMethod · 0.45

Tested by

no test coverage detected