All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.speedment.runtime.compute.expression.Expressions Maven / Gradle / Ivy

Go to download

A Speedment bundle that shades all dependencies into one jar. This is useful when deploying an application on a server.

The newest version!
/*
 *
 * Copyright (c) 2006-2019, Speedment, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); You may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at:
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.speedment.runtime.compute.expression;

import com.speedment.runtime.compute.*;
import com.speedment.runtime.compute.internal.BinaryJoiningExpressionImpl;
import com.speedment.runtime.compute.internal.JoiningExpressionImpl;
import com.speedment.runtime.compute.internal.ToByteNullableImpl;
import com.speedment.runtime.compute.internal.ToDoubleNullableImpl;
import com.speedment.runtime.compute.internal.expression.AbsUtil;
import com.speedment.runtime.compute.internal.expression.DivideUtil;
import com.speedment.runtime.compute.internal.expression.MinusUtil;
import com.speedment.runtime.compute.internal.expression.MultiplyUtil;
import com.speedment.runtime.compute.internal.expression.NegateUtil;
import com.speedment.runtime.compute.internal.expression.PlusUtil;
import com.speedment.runtime.compute.internal.expression.PowUtil;
import com.speedment.runtime.compute.internal.expression.SignUtil;
import com.speedment.runtime.compute.internal.expression.SqrtUtil;

import static java.util.Arrays.asList;

/**
 * Common mathematical expressions often used on Speedment entities.
 *
 * @author Emil Forslund
 * @since  3.1.0
 */
public final class Expressions {

     /**
     * Utility classes should not be instantiated.
     */
    private Expressions() {throw new UnsupportedOperationException();}

    ////////////////////////////////////////////////////////////////////////////
    //                               Conversions                              //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble byteToDouble(ToByte expression) {
        return expression.asDouble();
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble shortToDouble(ToShort expression) {
        return expression.asDouble();
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble intToDouble(ToInt expression) {
        return expression.asDouble();
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble longToDouble(ToLong expression) {
        return expression.asDouble();
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble floatToDouble(ToFloat expression) {
        return expression.asDouble();
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting. If the result of
     * the input is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable byteToDoubleNullable(ToByteNullable expression) {
        return expression.mapToDoubleIfPresent(b -> b);
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting. If the result of
     * the input is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable shortToDoubleNullable(ToShortNullable expression) {
        return expression.mapToDoubleIfPresent(b -> b);
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting. If the result of
     * the input is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable intToDoubleNullable(ToIntNullable expression) {
        return expression.mapToDoubleIfPresent(b -> b);
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting. If the result of
     * the input is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable longToDoubleNullable(ToLongNullable expression) {
        return expression.mapToDoubleIfPresent(b -> b);
    }

    /**
     * Creates and returns an expression that converts the result of the
     * specified expression into a {@code double} by casting. If the result of
     * the input is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the initial expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable floatToDoubleNullable(ToFloatNullable expression) {
        return expression.mapToDoubleIfPresent(b -> b);
    }
    
    ////////////////////////////////////////////////////////////////////////////
    //                              Absolute Value                            //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any).
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte abs(ToByte expression) {
        return AbsUtil.absByte(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any).
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToShort abs(ToShort expression) {
        return AbsUtil.absShort(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any).
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToInt abs(ToInt expression) {
        return AbsUtil.absInt(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any).
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToLong abs(ToLong expression) {
        return AbsUtil.absLong(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any).
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToFloat abs(ToFloat expression) {
        return AbsUtil.absFloat(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any).
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble abs(ToDouble expression) {
        return AbsUtil.absDouble(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any). If the result of the original
     * expression is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable absOrNull(ToByteNullable expression) {
        return AbsUtil.absByteOrNull(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any). If the result of the original
     * expression is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToShortNullable absOrNull(ToShortNullable expression) {
        return AbsUtil.absShortOrNull(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any). If the result of the original
     * expression is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToIntNullable absOrNull(ToIntNullable expression) {
        return AbsUtil.absIntOrNull(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any). If the result of the original
     * expression is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToLongNullable absOrNull(ToLongNullable expression) {
        return AbsUtil.absLongOrNull(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any). If the result of the original
     * expression is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToFloatNullable absOrNull(ToFloatNullable expression) {
        return AbsUtil.absFloatOrNull(expression);
    }

    /**
     * Returns an expression that takes an expression and returns its absolute
     * (removing the negation sign if any). If the result of the original
     * expression is {@code null}, then the new expression will also return
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable absOrNull(ToDoubleNullable expression) {
        return AbsUtil.absDoubleOrNull(expression);
    }

    ////////////////////////////////////////////////////////////////////////////
    //                               Get The Sign                             //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte sign(ToByte expression) {
        return SignUtil.signByte(expression);
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte sign(ToShort expression) {
        return SignUtil.signShort(expression);
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte sign(ToInt expression) {
        return SignUtil.signInt(expression);
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte sign(ToLong expression) {
        return SignUtil.signLong(expression);
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte sign(ToFloat expression) {
        return SignUtil.signFloat(expression);
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte sign(ToDouble expression) {
        return SignUtil.signDouble(expression);
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte sign(ToBigDecimal expression) {
        return SignUtil.signBigDecimal(expression);
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}. If the result of the given expression is
     * {@code null}, then the result of this expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable signOrNull(ToByteNullable expression) {
        return new ToByteNullableImpl<>(
            SignUtil.signByte(expression.orThrow()),
            expression.isNull());
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}. If the result of the given expression is
     * {@code null}, then the result of this expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable signOrNull(ToShortNullable expression) {
        return new ToByteNullableImpl<>(
            SignUtil.signShort(expression.orThrow()),
            expression.isNull());
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}. If the result of the given expression is
     * {@code null}, then the result of this expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable signOrNull(ToIntNullable expression) {
        return new ToByteNullableImpl<>(
            SignUtil.signInt(expression.orThrow()),
            expression.isNull());
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}. If the result of the given expression is
     * {@code null}, then the result of this expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable signOrNull(ToLongNullable expression) {
        return new ToByteNullableImpl<>(
            SignUtil.signLong(expression.orThrow()),
            expression.isNull());
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}. If the result of the given expression is
     * {@code null}, then the result of this expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable signOrNull(ToFloatNullable expression) {
        return new ToByteNullableImpl<>(
            SignUtil.signFloat(expression.orThrow()),
            expression.isNull());
    }

    /**
     * Creates and returns an expression that returns {@code 1} if the result of
     * the input expression is positive, {@code -1} if the result of the input
     * expression is negative and {@code 0} if the result of the input
     * expression is {@code 0}. If the result of the given expression is
     * {@code null}, then the result of this expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable signOrNull(ToDoubleNullable expression) {
        return new ToByteNullableImpl<>(
            SignUtil.signDouble(expression.orThrow()),
            expression.isNull());
    }

    ////////////////////////////////////////////////////////////////////////////
    //                               Square Root                              //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble sqrt(ToByte expression) {
        return SqrtUtil.sqrtByte(expression);
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble sqrt(ToShort expression) {
        return SqrtUtil.sqrtShort(expression);
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble sqrt(ToInt expression) {
        return SqrtUtil.sqrtInt(expression);
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble sqrt(ToLong expression) {
        return SqrtUtil.sqrtLong(expression);
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble sqrt(ToFloat expression) {
        return SqrtUtil.sqrtFloat(expression);
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble sqrt(ToDouble expression) {
        return SqrtUtil.sqrtDouble(expression);
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression. If the result of the input expression
     * is {@code null}, then the result of the new expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable sqrtOrNull(ToByteNullable expression) {
        return new ToDoubleNullableImpl<>(
            SqrtUtil.sqrtByte(expression.orThrow()),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression. If the result of the input expression
     * is {@code null}, then the result of the new expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable sqrtOrNull(ToShortNullable expression) {
        return new ToDoubleNullableImpl<>(
            SqrtUtil.sqrtShort(expression.orThrow()),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression. If the result of the input expression
     * is {@code null}, then the result of the new expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable sqrtOrNull(ToIntNullable expression) {
        return new ToDoubleNullableImpl<>(
            SqrtUtil.sqrtInt(expression.orThrow()),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression. If the result of the input expression
     * is {@code null}, then the result of the new expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable sqrtOrNull(ToLongNullable expression) {
        return new ToDoubleNullableImpl<>(
            SqrtUtil.sqrtLong(expression.orThrow()),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression. If the result of the input expression
     * is {@code null}, then the result of the new expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable sqrtOrNull(ToFloatNullable expression) {
        return new ToDoubleNullableImpl<>(
            SqrtUtil.sqrtFloat(expression.orThrow()),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that returns the square root of the
     * result from the input expression. If the result of the input expression
     * is {@code null}, then the result of the new expression will also be
     * {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable sqrtOrNull(ToDoubleNullable expression) {
        return new ToDoubleNullableImpl<>(
            SqrtUtil.sqrtDouble(expression.orThrow()),
            expression.isNull()
        );
    }

    ////////////////////////////////////////////////////////////////////////////
    //                                 Power                                  //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToByte expression, int power) {
        return PowUtil.bytePowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToByte expression, double power) {
        return PowUtil.bytePowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToByte expression, ToInt power) {
        return PowUtil.bytePowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToByte expression, ToDouble power) {
        return PowUtil.bytePowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToByteNullable expression, int power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.bytePowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToByteNullable expression, double power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.bytePowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToByteNullable expression, ToInt power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.bytePowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToByteNullable expression, ToDouble power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.bytePowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToShort expression, int power) {
        return PowUtil.shortPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToShort expression, double power) {
        return PowUtil.shortPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToShort expression, ToInt power) {
        return PowUtil.shortPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToShort expression, ToDouble power) {
        return PowUtil.shortPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToShortNullable expression, int power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.shortPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToShortNullable expression, double power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.shortPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToShortNullable expression, ToInt power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.shortPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToShortNullable expression, ToDouble power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.shortPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToInt expression, int power) {
        return PowUtil.intPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToInt expression, double power) {
        return PowUtil.intPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToInt expression, ToInt power) {
        return PowUtil.intPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToInt expression, ToDouble power) {
        return PowUtil.intPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToIntNullable expression, int power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.intPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToIntNullable expression, double power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.intPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToIntNullable expression, ToInt power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.intPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToIntNullable expression, ToDouble power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.intPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToLong expression, int power) {
        return PowUtil.longPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToLong expression, double power) {
        return PowUtil.longPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToLong expression, ToInt power) {
        return PowUtil.longPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToLong expression, ToDouble power) {
        return PowUtil.longPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToLongNullable expression, int power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.longPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToLongNullable expression, double power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.longPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToLongNullable expression, ToInt power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.longPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToLongNullable expression, ToDouble power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.longPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToFloat expression, int power) {
        return PowUtil.floatPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToFloat expression, double power) {
        return PowUtil.floatPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToFloat expression, ToInt power) {
        return PowUtil.floatPowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToFloat expression, ToDouble power) {
        return PowUtil.floatPowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToFloatNullable expression, int power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.floatPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToFloatNullable expression, double power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.floatPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToFloatNullable expression, ToInt power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.floatPowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToFloatNullable expression, ToDouble power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.floatPowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToDouble expression, int power) {
        return PowUtil.doublePowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToDouble expression, double power) {
        return PowUtil.doublePowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToDouble expression, ToInt power) {
        return PowUtil.doublePowInt(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble pow(ToDouble expression, ToDouble power) {
        return PowUtil.doublePowDouble(expression, power);
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToDoubleNullable expression, int power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.doublePowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself {@code power} times.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToDoubleNullable expression, double power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.doublePowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToDoubleNullable expression, ToInt power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.doublePowInt(expression.orThrow(), power),
            expression.isNull()
        );
    }

    /**
     * Creates and returns an expression that takes the result of an input
     * expression and multiplies it with itself as many times as the result of
     * applying {@code power} to the input.
     *
     * @param expression  the input expression
     * @param power       the power
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable
    powOrNull(ToDoubleNullable expression, ToDouble power) {
        return new ToDoubleNullableImpl<>(
            PowUtil.doublePowDouble(expression.orThrow(), power),
            expression.isNull()
        );
    }
    
    ////////////////////////////////////////////////////////////////////////////
    //                                 Negate                                 //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByte negate(ToByte expression) {
        return NegateUtil.negateByte(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToShort negate(ToShort expression) {
        return NegateUtil.negateShort(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToInt negate(ToInt expression) {
        return NegateUtil.negateInt(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToLong negate(ToLong expression) {
        return NegateUtil.negateLong(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToFloat negate(ToFloat expression) {
        return NegateUtil.negateFloat(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDouble negate(ToDouble expression) {
        return NegateUtil.negateDouble(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToBigDecimal negate(ToBigDecimal expression) {
        return NegateUtil.negateBigDecimal(expression);
    }


    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToBoolean negate(ToBoolean expression) {
        return NegateUtil.negateBoolean(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression. If the specified expression results in
     * {@code null}, then the new expression will also return {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToByteNullable negateOrNull(ToByteNullable expression) {
        return NegateUtil.negateByteOrNull(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression. If the specified expression results in
     * {@code null}, then the new expression will also return {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToShortNullable negateOrNull(ToShortNullable expression) {
        return NegateUtil.negateShortOrNull(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression. If the specified expression results in
     * {@code null}, then the new expression will also return {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToIntNullable negateOrNull(ToIntNullable expression) {
        return NegateUtil.negateIntOrNull(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression. If the specified expression results in
     * {@code null}, then the new expression will also return {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToLongNullable negateOrNull(ToLongNullable expression) {
        return NegateUtil.negateLongOrNull(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression. If the specified expression results in
     * {@code null}, then the new expression will also return {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToFloatNullable negateOrNull(ToFloatNullable expression) {
        return NegateUtil.negateFloatOrNull(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression. If the specified expression results in
     * {@code null}, then the new expression will also return {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToDoubleNullable negateOrNull(ToDoubleNullable expression) {
        return NegateUtil.negateDoubleOrNull(expression);
    }

    /**
     * Creates and returns an expression that will compute the negative result
     * of the specified expression. If the specified expression results in
     * {@code null}, then the new expression will also return {@code null}.
     *
     * @param expression  the input expression
     * @param          the input type
     * @return            the new expression
     */
    public static  ToBooleanNullable negateOrNull(ToBooleanNullable expression) {
        return NegateUtil.negateBooleanOrNull(expression);
    }

    ////////////////////////////////////////////////////////////////////////////
    //                                  Plus                                  //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToShort plus(ToByte first, byte second) {
        return PlusUtil.bytePlusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt plus(ToByte first, int second) {
        return PlusUtil.bytePlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToByte first, long second) {
        return PlusUtil.bytePlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToShort plus(ToByte first, ToByte second) {
        return PlusUtil.bytePlusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt plus(ToShort first, byte second) {
        return PlusUtil.shortPlusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt plus(ToShort first, int second) {
        return PlusUtil.shortPlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToShort first, long second) {
        return PlusUtil.shortPlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToShort plus(ToShort first, ToShort second) {
        return PlusUtil.shortPlusShort(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt plus(ToInt first, byte second) {
        return PlusUtil.intPlusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt plus(ToInt first, int second) {
        return PlusUtil.intPlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToInt first, long second) {
        return PlusUtil.intPlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt plus(ToInt first, ToByte second) {
        return PlusUtil.intPlusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt plus(ToInt first, ToInt second) {
        return PlusUtil.intPlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToLong first, byte second) {
        return PlusUtil.longPlusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToLong first, int second) {
        return PlusUtil.longPlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToLong first, long second) {
        return PlusUtil.longPlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToLong first, ToInt second) {
        return PlusUtil.longPlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong plus(ToLong first, ToLong second) {
        return PlusUtil.longPlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat plus(ToFloat first, int second) {
        return PlusUtil.floatPlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToFloat first, long second) {
        return PlusUtil.floatPlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat plus(ToFloat first, float second) {
        return PlusUtil.floatPlusFloat(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat plus(ToFloat first, ToInt second) {
        return PlusUtil.floatPlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToFloat first, ToLong second) {
        return PlusUtil.floatPlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat plus(ToFloat first, ToFloat second) {
        return PlusUtil.floatPlusFloat(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToDouble first, int second) {
        return PlusUtil.doublePlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToDouble first, long second) {
        return PlusUtil.doublePlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and adds a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToDouble first, double second) {
        return PlusUtil.doublePlusDouble(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToDouble first, ToInt second) {
        return PlusUtil.doublePlusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToDouble first, ToLong second) {
        return PlusUtil.doublePlusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and add them together.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble plus(ToDouble first, ToDouble second) {
        return PlusUtil.doublePlusDouble(first, second);
    }
    
    ////////////////////////////////////////////////////////////////////////////
    //                                Minus                                   //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToShort minus(ToByte first, byte second) {
        return MinusUtil.byteMinusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt minus(ToByte first, int second) {
        return MinusUtil.byteMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToByte first, long second) {
        return MinusUtil.byteMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToShort minus(ToByte first, ToByte second) {
        return MinusUtil.byteMinusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt minus(ToShort first, byte second) {
        return MinusUtil.shortMinusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt minus(ToShort first, int second) {
        return MinusUtil.shortMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToShort first, long second) {
        return MinusUtil.shortMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToShort minus(ToShort first, ToShort second) {
        return MinusUtil.shortMinusShort(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt minus(ToInt first, byte second) {
        return MinusUtil.intMinusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt minus(ToInt first, int second) {
        return MinusUtil.intMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToInt first, long second) {
        return MinusUtil.intMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt minus(ToInt first, ToByte second) {
        return MinusUtil.intMinusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt minus(ToInt first, ToInt second) {
        return MinusUtil.intMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToLong first, byte second) {
        return MinusUtil.longMinusByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToLong first, int second) {
        return MinusUtil.longMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToLong first, long second) {
        return MinusUtil.longMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToLong first, ToInt second) {
        return MinusUtil.longMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong minus(ToLong first, ToLong second) {
        return MinusUtil.longMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat minus(ToFloat first, int second) {
        return MinusUtil.floatMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToFloat first, long second) {
        return MinusUtil.floatMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat minus(ToFloat first, float second) {
        return MinusUtil.floatMinusFloat(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat minus(ToFloat first, ToInt second) {
        return MinusUtil.floatMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToFloat first, ToLong second) {
        return MinusUtil.floatMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat minus(ToFloat first, ToFloat second) {
        return MinusUtil.floatMinusFloat(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToDouble first, int second) {
        return MinusUtil.doubleMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToDouble first, long second) {
        return MinusUtil.doubleMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and subtracts a constant from it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToDouble first, double second) {
        return MinusUtil.doubleMinusDouble(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToDouble first, ToInt second) {
        return MinusUtil.doubleMinusInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToDouble first, ToLong second) {
        return MinusUtil.doubleMinusLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the difference.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble minus(ToDouble first, ToDouble second) {
        return MinusUtil.doubleMinusDouble(first, second);
    }

    ////////////////////////////////////////////////////////////////////////////
    //                               Multiply                                 //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToByte first, byte second) {
        return MultiplyUtil.byteMultiplyByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToByte first, int second) {
        return MultiplyUtil.byteMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToByte first, long second) {
        return MultiplyUtil.byteMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToByte first, ToByte second) {
        return MultiplyUtil.byteMultiplyByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToShort first, byte second) {
        return MultiplyUtil.shortMultiplyByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToShort first, int second) {
        return MultiplyUtil.shortMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToShort first, long second) {
        return MultiplyUtil.shortMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToShort first, ToShort second) {
        return MultiplyUtil.shortMultiplyShort(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToInt first, byte second) {
        return MultiplyUtil.intMultiplyByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToInt first, int second) {
        return MultiplyUtil.intMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToInt first, long second) {
        return MultiplyUtil.intMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToInt first, ToByte second) {
        return MultiplyUtil.intMultiplyByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToInt multiply(ToInt first, ToInt second) {
        return MultiplyUtil.intMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToLong first, byte second) {
        return MultiplyUtil.longMultiplyByte(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToLong first, int second) {
        return MultiplyUtil.longMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToLong first, long second) {
        return MultiplyUtil.longMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToLong first, ToInt second) {
        return MultiplyUtil.longMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToLong multiply(ToLong first, ToLong second) {
        return MultiplyUtil.longMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat multiply(ToFloat first, int second) {
        return MultiplyUtil.floatMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToFloat first, long second) {
        return MultiplyUtil.floatMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat multiply(ToFloat first, float second) {
        return MultiplyUtil.floatMultiplyFloat(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat multiply(ToFloat first, ToInt second) {
        return MultiplyUtil.floatMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToFloat first, ToLong second) {
        return MultiplyUtil.floatMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToFloat multiply(ToFloat first, ToFloat second) {
        return MultiplyUtil.floatMultiplyFloat(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToDouble first, int second) {
        return MultiplyUtil.doubleMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToDouble first, long second) {
        return MultiplyUtil.doubleMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the expression
     * and multiplies a constant to it.
     *
     * @param first   the first input expression
     * @param second  the second input constant
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToDouble first, double second) {
        return MultiplyUtil.doubleMultiplyDouble(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToDouble first, ToInt second) {
        return MultiplyUtil.doubleMultiplyInt(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToDouble first, ToLong second) {
        return MultiplyUtil.doubleMultiplyLong(first, second);
    }

    /**
     * Creates and returns an expression that takes the result of the two
     * expressions and computes the product.
     *
     * @param first   the first input expression
     * @param second  the second input expression
     * @param      the input type
     * @return        the new expression
     */
    public static  ToDouble multiply(ToDouble first, ToDouble second) {
        return MultiplyUtil.doubleMultiplyDouble(first, second);
    }

    ////////////////////////////////////////////////////////////////////////////
    //                               Division                                 //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToByte first, int second) {
        return DivideUtil.byteDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToByte first, long second) {
        return DivideUtil.byteDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToByte first, double second) {
        return DivideUtil.byteDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToByte first, ToInt second) {
        return DivideUtil.byteDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToByte first, ToLong second) {
        return DivideUtil.byteDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToByte first, ToDouble second) {
        return DivideUtil.byteDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToShort first, int second) {
        return DivideUtil.shortDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToShort first, long second) {
        return DivideUtil.shortDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToShort first, double second) {
        return DivideUtil.shortDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToShort first, ToInt second) {
        return DivideUtil.shortDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToShort first, ToLong second) {
        return DivideUtil.shortDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToShort first, ToDouble second) {
        return DivideUtil.shortDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToInt first, int second) {
        return DivideUtil.intDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToInt first, long second) {
        return DivideUtil.intDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToInt first, double second) {
        return DivideUtil.intDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToInt first, ToInt second) {
        return DivideUtil.intDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToInt first, ToLong second) {
        return DivideUtil.intDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToInt first, ToDouble second) {
        return DivideUtil.intDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToLong first, int second) {
        return DivideUtil.longDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToLong first, long second) {
        return DivideUtil.longDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToLong first, double second) {
        return DivideUtil.longDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToLong first, ToInt second) {
        return DivideUtil.longDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToLong first, ToLong second) {
        return DivideUtil.longDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToLong first, ToDouble second) {
        return DivideUtil.longDivideDouble(first, second);
    }

    ////////////////////////////////////////////////////////////////////////////
    //                                 ToFloat                                //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToFloat first, int second) {
        return DivideUtil.floatDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToFloat first, long second) {
        return DivideUtil.floatDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToFloat first, double second) {
        return DivideUtil.floatDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToFloat first, ToInt second) {
        return DivideUtil.floatDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToFloat first, ToLong second) {
        return DivideUtil.floatDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToFloat first, ToDouble second) {
        return DivideUtil.floatDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToDouble first, int second) {
        return DivideUtil.doubleDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToDouble first, long second) {
        return DivideUtil.doubleDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToDouble first, double second) {
        return DivideUtil.doubleDivideDouble(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToDouble first, ToInt second) {
        return DivideUtil.doubleDivideInt(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToDouble first, ToLong second) {
        return DivideUtil.doubleDivideLong(first, second);
    }

    /**
     * Returns an expression that takes the result from the first expression and
     * divides it with the result of the second expression. The second
     * expression must never return {@code 0}!
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the division expression
     */
    public static  ToDouble divide(ToDouble first, ToDouble second) {
        return DivideUtil.doubleDivideDouble(first, second);
    }

    ////////////////////////////////////////////////////////////////////////////
    //                                ToString                                //
    ////////////////////////////////////////////////////////////////////////////

    /**
     * Returns an expression that represents the result of the two specified
     * expressions joined together, forming a single string.
     *
     * @param first   the first expression
     * @param second  the second expression
     * @param      the input entity type
     * @return        the joined expression
     */
    public static  ToString joining(
            ToString first,
            ToString second) {
        return joining("", first, second);
    }

    /**
     * Returns an expression that represents the result of the two specified
     * expressions joined together with a separator between them, forming a
     * single string.
     *
     * @param separator  the separator (may be empty but never {@code null})
     * @param first      the first expression
     * @param second     the second expression
     * @param         the input entity type
     * @return           the joined expression
     */
    public static  ToString joining(
            CharSequence separator,
            ToString first,
            ToString second) {
        return joining(separator, "", "", first, second);
    }

    /**
     * Returns an expression that represents the result of the two specified
     * expressions joined together with a separator between them, with a prefix
     * before the entire result and a suffix after it, forming a single string.
     *
     * @param separator  the separator (may be empty but never {@code null})
     * @param prefix     the prefix to put before the whole result
     * @param suffix     the suffix to put after the whole result
     * @param first      the first expression
     * @param second     the second expression
     * @param         the input entity type
     * @return           the joined expression
     */
    public static  ToString joining(
            CharSequence separator,
            CharSequence prefix,
            CharSequence suffix,
            ToString first,
            ToString second) {
        return new BinaryJoiningExpressionImpl<>(separator, prefix, suffix, first, second);
    }

    /**
     * Returns an expression that represents the result of all the specified
     * expressions joined together, forming a single string.
     *
     * @param expressions  the array of expressions to join
     * @param           the input entity type
     * @return             the joined expression
     */
    @SafeVarargs
    public static  ToString joining(
            ToString... expressions) {
        return joining("", expressions);
    }

    /**
     * Returns an expression that represents the result of all the specified
     * expressions joined together with separators between them, forming a
     * single string.
     *
     * @param separator    the separator (may be empty but never {@code null})
     * @param expressions  the array of expressions to join
     * @param           the input entity type
     * @return             the joined expression
     */
    @SafeVarargs
    public static  ToString joining(
            CharSequence separator,
            ToString... expressions) {
        return joining(separator, "", "", expressions);
    }

    /**
     * Returns an expression that represents the result of all the specified
     * expressions joined together with separators between them, with a prefix
     * before the entire result and a suffix after it, forming a single string.
     *
     * @param separator    the separator (may be empty but never {@code null})
     * @param prefix       the prefix to put before the whole result
     * @param suffix       the suffix to put after the whole result
     * @param expressions  the array of expressions to join
     * @param           the input entity type
     * @return             the joined expression
     */
    @SafeVarargs
    public static  ToString joining(
            CharSequence separator,
            CharSequence prefix,
            CharSequence suffix,
            ToString... expressions) {
        return new JoiningExpressionImpl<>(separator, prefix, suffix, asList(expressions));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy