public void visit(ArithmeticNode node) {
        if (state == null ) return;
        if (node.getItems().size() > 2) {
            throw new IllegalArgumentException("Too many arithmetic operations");
        }
        for (ArithmeticNode.NodeItem item : node.getItems()) {
            if (item.getOperator() != ArithmeticNode.SUB && item.getOperator() != ArithmeticNode.NOP) {
                throw new IllegalArgumentException("Arithmetic operator '" + node.operatorToString(item.getOperator()) + "' is not supported");
            }
        }
        state.arithmetic = node;

    }
Class which converts a selection tree into a set of queries per document type.
If unsupported operations are or illegal arguments are encountered, an exception is thrown.

@author Ulf Lilleengen
document/src/main/java/com/yahoo/document/select/convert/SelectionExpressionConverter.java