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

se.kuseman.payloadbuilder.api.expression.IArithmeticBinaryExpression Maven / Gradle / Ivy

package se.kuseman.payloadbuilder.api.expression;

/** Arithmetic binary expression */
public interface IArithmeticBinaryExpression extends IBinaryExpression
{
    /** Get type of arithmetics */
    Type getArithmeticType();

    /** Type */
    public enum Type
    {
        ADD("+", true),
        SUBTRACT("-", false),
        MULTIPLY("*", true),
        DIVIDE("/", false),
        MODULUS("%", false);

        private final String sign;
        private final boolean commutative;

        Type(String sign, boolean commutative)
        {
            this.sign = sign;
            this.commutative = commutative;
        }

        public String getSign()
        {
            return sign;
        }

        public boolean isCommutative()
        {
            return commutative;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy