/** * INTERNAL: Add a child and ensure it is the rightmost in the tree as long as it is in the tree * If there is already a node that is set as therightmost node, replace it * * @param argument */ public synchronized void addRightMostChild(Expression argument) { if (hasLastChild != null && hasLastChild.booleanValue()) { getChildren().remove(super.getChildren().size() - 1); super.addChild(argument); } else { this.addChild(argument); } this.hasLastChild = Boolean.TRUE; }
/** * INTERNAL: Add a new Expression to the list of arguments. This method will update the list of * arguments and any constant strings that are required to be printed with the arguments * * @param argument */ @Override public synchronized void addChild(Expression argument) { if (hasLastChild != null && hasLastChild.booleanValue()) { getChildren().add(getChildren().size() - 1, argument); } else { super.addChild(argument); } setBaseExpression((Expression) getChildren().firstElement()); ((ListExpressionOperator) operator).incrementNumberOfItems(); }