Create a new Operation expression

@param type type of expression
@param operator operator
@param args operation arguments
@return operation expression
510450
public static <T extends Comparable<?>> TimeOperation<T> timeOperation(Class<? extends T> type,
            Operator operator, Expression<?>... args) {
        return new TimeOperation<T>(type, operator, args);
    }
1343339
public static <T> DslOperation<T> dslOperation(Class<? extends T> type, Operator operator,
            Expression<?>... args) {
        return new DslOperation<T>(type, operator, args);
    }
242220
public static PointExpression<Point> pointOperation(Operator op, Expression<?>... args) {
        return new PointOperation<Point>(Point.class, op, args);
    }
270224
public Signature argType(int index, Class<?> type) {
        return new Signature(type().changeParameterType(index, type), argNames());
    }
217733
@Override
    protected String naryOperator(final NAryOperator operator, final String opString) {
        final List<Formula> operands = new ArrayList<>();
        for (final Formula op : operator) {
            operands.add(op);
        }
        final int size = operator.numberOfOperands();
        Collections.sort(operands, this.comparator);
        final StringBuilder sb = new StringBuilder();
        int count = 0;
        Formula last = null;
        for (final Formula op : operands) {
            if (++count == size) {
                last = op;
            } else {
                sb.append(operator.type().precedence() < op.type().precedence() ? toString(op) : bracket(op));
                sb.append(opString);
            }
        }
        if (last != null) {
            sb.append(operator.type().precedence() < last.type().precedence() ? toString(last) : bracket(last));
        }
        return sb.toString();
    }
1116599
public static Expression construct(Expression ctor, Expression... args) {
    return New.create(ctor).call(args);
  }
521275
@Override
	public void addOperator(String operator, FunctionDescriptor fd)
    {
        m_operatorMap.put(operator, fd);
    }
1240929
function (operator, field) {
            if (!this.query.where) {
                return null;
            }

            function findExpression(expressions) {
                var expression,
                    ret = null;
                for (var i = 0; i < expressions.length; i++) {
                    expression = expressions[i];
                    if (expression instanceof Where) {
                        ret = findExpression(expression.expressions);
                    } else if (expression instanceof Comparator) {
                        if (expression.operator == operator && expression.field == field) {
                            ret = expression;
                        }
                    }
                    if (ret) {
                        return ret;
                    }

                }
                return ret;
            }

            return findExpression(this.query.where.expressions);
        }
1003152
public static Expression fields(String operator, Val<Expression>[] args, QueryExprMeta parent) {
        if (args.length < 1) {
            throw new QuerySyntaxException(Messages.get("dsl.arguments.error2", operator, 0));
        }
        if (parent == null) {
            throw new QuerySyntaxException(Messages.get("dsl.arguments.error5", operator));
        } else if (!parent.operator().equals("option")) {
            throw new QuerySyntaxException(Messages.get("dsl.arguments.error6", operator, "option"));
        }

        return TextFieldsExpression.of(args);
    }
800814
public static TerminalOp<Double, OptionalDouble>
    makeDouble(DoubleBinaryOperator operator) {
        Objects.requireNonNull(operator);
        class ReducingSink
                implements AccumulatingSink<Double, OptionalDouble, ReducingSink>, Sink.OfDouble {
            private boolean empty;
            private double state;

            public void begin(long size) {
                empty = true;
                state = 0;
            }

            @Override
            public void accept(double t) {
                if (empty) {
                    empty = false;
                    state = t;
                }
                else {
                    state = operator.applyAsDouble(state, t);
                }
            }

            @Override
            public OptionalDouble get() {
                return empty ? OptionalDouble.empty() : OptionalDouble.of(state);
            }

            @Override
            public void combine(ReducingSink other) {
                if (!other.empty)
                    accept(other.state);
            }
        }
        return new ReduceOp<Double, OptionalDouble, ReducingSink>(StreamShape.DOUBLE_VALUE) {
            @Override
            public ReducingSink makeSink() {
                return new ReducingSink();
            }
        };
    }
275379
public static <T extends Enum<T>> EnumOperation<T> enumOperation(Class<? extends T> type, Operator operator,
                                                                     Expression<?>... args) {
        return new EnumOperation<T>(type, operator, args);
    }
1005753
public static FunctionalType unaryOperator(TypeMirror type) {
    checkArgument(!type.getKind().isPrimitive(), "Unexpected primitive type %s", type);
    return new FunctionalType(
        QualifiedName.of(UnaryOperator.class).withParameters(type),
        "apply",
        ImmutableList.of(type),
        type);
  }
582764
private static Operator substitute(Operator oper, List[] equatedIds) {
    Selector op1 = oper.getOperands()[0];
    Selector op2 = (oper.getOperands().length == 1) ? null : oper.getOperands()[1];
    if (op1 instanceof Identifier)
      op1 = substitute((Identifier) op1, equatedIds);
    else if (op1 instanceof Operator)
      op1 = substitute((Operator) op1, equatedIds);
    if (op1 == null)
      return null;
    if (op2 != null) {
      if (op2 instanceof Identifier)
        op2 = substitute((Identifier) op2, equatedIds);
      else if (op2 instanceof Operator)
        op2 = substitute((Operator) op2, equatedIds);
      if (op2 == null)
        return null;
    }
    if (op1 == oper.getOperands()[0] && (op2 == null || op2 == oper.getOperands()[1]))
      return oper;
    else if (oper instanceof LikeOperator) {
      LikeOperatorImpl loper = (LikeOperatorImpl) oper;
        return new LikeOperatorImpl(loper.getOp(), op1, loper.getInternalPattern(), loper.getPattern(), loper.isEscaped(), loper.getEscape());
    }
    else
      return (op2 == null) ? new OperatorImpl(oper.getOp(), op1) : new OperatorImpl(oper.getOp(), op1, op2);
  }
873204
@Override
	@PublicEvolving
	public <R> SingleOutputStreamOperator<R> transform(String operatorName,
			TypeInformation<R> outTypeInfo, OneInputStreamOperator<T, R> operator) {

		SingleOutputStreamOperator<R> returnStream = super.transform(operatorName, outTypeInfo, operator);

		// inject the key selector and key type
		OneInputTransformation<T, R> transform = (OneInputTransformation<T, R>) returnStream.getTransformation();
		transform.setStateKeySelector(keySelector);
		transform.setStateKeyType(keyType);

		return returnStream;
	}
1060251
public static LineStringExpression<LineString> lineStringOperation(Operator op, Expression<?>... args) {
        return new LineStringOperation<LineString>(LineString.class, op, args);
    }
966073
public static <T> UnaryOperator<T> unaryOperator(CheckedUnaryOperator<T> operator) {
        return unaryOperator(operator, THROWABLE_TO_RUNTIME_EXCEPTION);
    }
181940
public ExpressionBuilder operator(Operator operator) {
        this.checkOperatorSymbol(operator);
        this.userOperators.put(operator.getSymbol(), operator);
        return this;
    }