Add an {@link net.objecthunter.exp4j.operator.Operator} which should be available for use in the expression
@param operator the custom {@link net.objecthunter.exp4j.operator.Operator} to add
@return the ExpressionBuilder instance
181940
public ExpressionBuilder operator(Operator operator) {
        this.checkOperatorSymbol(operator);
        this.userOperators.put(operator.getSymbol(), operator);
        return this;
    }
60431
private SelectorBuilderImpl multipleValuePredicate(String field, String[] propertyValues,
      PredicateOperator operator) {
    if (propertyValues == null) {
      return this;
    }

    Predicate predicate = new Predicate();
    predicate.setOperator(operator);
    predicate.setField(field);

    String[] values = Arrays.copyOf(propertyValues, propertyValues.length);

    predicate.setValues(values);

    this.predicates.add(predicate);

    return this;
  }
408054
public <X> DataSet<X> runOperation(CustomUnaryOperation<T, X> operation) {
		Preconditions.checkNotNull(operation, "The custom operator must not be null.");
		operation.setInput(this);
		return operation.createResult();
	}
826855
public static GeometryExpression<Geometry> geometryOperation(Operator op, Expression<?>... args) {
        return new GeometryOperation<Geometry>(Geometry.class, op, args);
    }
172748
public ClassBuilder<T> withMethod(Method method, Expression expression) {
		methods.put(method, expression);
		return this;
	}
345932
public static JTSPointExpression<Point> pointOperation(Operator op, Expression<?>... args) {
        return new JTSPointOperation<Point>(Point.class, op, args);
    }
540082
public function addOperator(string $operator): self
    {
        $this->validateOperator($operator);
        if (!in_array($operator, $this->operators)) {
            $this->operators[] = $operator;
        }

        return $this;
    }
524470
def add(self, operator):
        '''
        '''
        if not isinstance(operator, Scope):
            raise ParameterError('Operator {} must be a TaskTransformer '
                                 'or FeatureExtractor'.format(operator))
        for key in operator.fields:
            self._time[key] = []
            # We add 1 to the dimension here to account for batching
            for tdim, idx in enumerate(operator.fields[key].shape, 1):
                if idx is None:
                    self._time[key].append(tdim)
842398
public void invokeOperator(PdfLiteral operator, ArrayList operands) {
		ContentOperator op = operators.get(operator.toString());
		if (op == null) {
			// skipping unssupported operator
			return;
		}
		op.invoke(this, operator, operands);
	}
293494
final public ReturnExpressionBuilder<T> returnExp() {
    final int sourceLineNumber = builder.getSourceLineNumber();
    return new ReturnExpressionBuilder<T>(new ExpressionHandler<T>() {
      public T handleExpression(Expression e) {
        return statementHandler().handleStatement(new ReturnStatement(sourceLineNumber, e));
      }
    });
  }
144853
public static IndexOperator getIndexOperator(String operator)
    {
        if (operator.equals("="))
        {
            return IndexOperator.EQ;
        }
        else if (operator.equals(">="))
        {
            return IndexOperator.GTE;
        }
        else if (operator.equals(">"))
        {
            return IndexOperator.GT;
        }
        else if (operator.equals("<"))
        {
            return IndexOperator.LT;
        }
        else if (operator.equals("<="))
        {
            return IndexOperator.LTE;
        }

        return null;
    }
957067
private FieldTextBuilder binaryOperation(final String operator, final FieldText fieldText) {
        // This should never happen as the AND, OR, XOR and WHEN methods should already have checked this
        Validate.isTrue(fieldText != this);

        // Optimized case when fieldText is a FieldTextBuilder
        if(fieldText instanceof FieldTextBuilder) {
            return binaryOp(operator, (FieldTextBuilder)fieldText);
        }

        // Special case when we're empty
        if(componentCount == 0) {
            fieldTextString.append(fieldText.toString());

            if(fieldText.size() > 1) {
                lastOperator = "";
            }
        } else {
            // Add the NOTs, parentheses and operator
            addOperator(operator);

            // Size 1 means a single specifier, so no parentheses
            if(fieldText.size() == 1) {
                fieldTextString.append(fieldText.toString());
            } else {
                fieldTextString.append('(').append(fieldText.toString()).append(')');
            }
        }

        componentCount += fieldText.size();
        not = false;

        return this;
    }
509783
public static Expression createExpression(String expression) {
        try {
            return INSTANCE.ctorExpression.newInstance(expression);
        }
        catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
983261
private FieldTextBuilder binaryOp(final String operator, final FieldTextBuilder fieldText) {
        // Special case when we're empty
        if(componentCount == 0) {
            // Just copy the argument
            fieldTextString.append(fieldText.fieldTextString);
            lastOperator = fieldText.lastOperator;
            not = fieldText.not;
            componentCount = fieldText.componentCount;
        } else {
            // Add the NOTs, parentheses and operator
            addOperator(operator);

            if(fieldText.lastOperator == null || fieldText.lastOperator.equals(operator) || fieldText.not) {
                fieldTextString.append(fieldText.toString());
            } else {
                fieldTextString.append('(').append(fieldText.toString()).append(')');
            }

            componentCount += fieldText.size();
            not = false;
        }

        return this;
    }
1317963
@SuppressWarnings("checkstyle:cyclomaticcomplexity")
	protected XExpression _generate(XBinaryOperation operation, IAppendable it, IExtraLanguageGeneratorContext context) {
		appendReturnIfExpectedReturnedExpression(it, context);
		final String operator = getOperatorSymbol(operation);
		if (operator != null) {
			it.append("("); //$NON-NLS-1$
			generate(operation.getLeftOperand(), it, context);
			switch (operator) {
			case "-": //$NON-NLS-1$
			case "+": //$NON-NLS-1$
			case "*": //$NON-NLS-1$
			case "/": //$NON-NLS-1$
			case "%": //$NON-NLS-1$
			case "-=": //$NON-NLS-1$
			case "+=": //$NON-NLS-1$
			case "*=": //$NON-NLS-1$
			case "/=": //$NON-NLS-1$
			case "%=": //$NON-NLS-1$
			case "<": //$NON-NLS-1$
			case ">": //$NON-NLS-1$
			case "<=": //$NON-NLS-1$
			case ">=": //$NON-NLS-1$
			case "==": //$NON-NLS-1$
			case "!=": //$NON-NLS-1$
			case "<<": //$NON-NLS-1$
			case ">>": //$NON-NLS-1$
				it.append(" ").append(operator).append(" "); //$NON-NLS-1$ //$NON-NLS-2$
				break;
			case "&&": //$NON-NLS-1$
				it.append(" and "); //$NON-NLS-1$
				break;
			case "||": //$NON-NLS-1$
				it.append(" or "); //$NON-NLS-1$
				break;
			case "===": //$NON-NLS-1$
				it.append(" is "); //$NON-NLS-1$
				break;
			case "!==": //$NON-NLS-1$
				it.append(" is not "); //$NON-NLS-1$
				break;
			default:
				throw new IllegalArgumentException(MessageFormat.format(Messages.PyExpressionGenerator_0, operator));
			}
			generate(operation.getRightOperand(), it, context);
			it.append(")"); //$NON-NLS-1$
		}
		return operation;
	}
420695
public static String operatorToString(int op) {
        String result = operatorNames.get(op);
        if (result == null)
            throw new IllegalArgumentException("Invalid operator: " + op);
        return result;
    }
1362669
@NonNull
    public Expression add(@NonNull Expression expression) {
        if (expression == null) {
            throw new IllegalArgumentException("expression cannot be null.");
        }
        return new BinaryExpression(this, expression, BinaryExpression.OpType.Add);
    }