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

com.sap.cds.ql.cqn.CqnArithmeticExpression Maven / Gradle / Ivy

There is a newer version: 3.8.0
Show newest version
/*******************************************************************
 * © 2020 SAP SE or an SAP affiliate company. All rights reserved. *
 *******************************************************************/
package com.sap.cds.ql.cqn;

public interface CqnArithmeticExpression extends CqnExpression {

	CqnValue left();

	CqnValue right();

	Operator operator();

	@Override
	default boolean isArithmeticExpression() {
		return true;
	}

	@Override
	default CqnArithmeticExpression asArithmeticExpression() {
		return this;
	}

	@Override
	default void accept(CqnVisitor visitor) {
		left().accept(visitor);
		right().accept(visitor);

		visitor.visit(this);
	}

	public enum Operator {

		/**
		 * Addition operator
		 */
		ADD("+"),

		/**
		 * Subtraction operator
		 */
		SUB("-"),

		/**
		 * Multiplication operator
		 */
		MUL("*"),

		/**
		 * Division operator
		 */
		DIV("/");

		private final String symbol;

		private Operator(String op) {
			this.symbol = op;
		}

		public String symbol() {
			return symbol;
		}
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy