| 82 | } |
| 83 | |
| 84 | public void addSubExpression(final ExpressionTree child, final int param_index) { |
| 85 | if (child == null) { |
| 86 | throw new IllegalArgumentException("Cannot add a null child tree"); |
| 87 | } |
| 88 | if (child == this) { |
| 89 | throw new IllegalDataException("Recursive sub expression detected: " |
| 90 | + this); |
| 91 | } |
| 92 | if (param_index < 0) { |
| 93 | throw new IllegalArgumentException("Parameter index must be 0 or greater"); |
| 94 | } |
| 95 | if (sub_expressions == null) { |
| 96 | sub_expressions = Lists.newArrayList(); |
| 97 | } |
| 98 | sub_expressions.add(child); |
| 99 | parameter_index.put(param_index, Parameter.SUB_EXPRESSION); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Sets the metric query key and index, setting the Parameter type to |