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

org.hisrc.jscm.codemodel.expression.impl.LogicalANDExpressionImpl Maven / Gradle / Ivy

The newest version!
package org.hisrc.jscm.codemodel.expression.impl;

import org.hisrc.jscm.codemodel.JSCodeModel;
import org.hisrc.jscm.codemodel.expression.JSBitwiseORExpression;
import org.hisrc.jscm.codemodel.expression.JSExpressionVisitor;
import org.hisrc.jscm.codemodel.expression.JSLogicalANDExpression;
import org.hisrc.jscm.codemodel.lang.Validate;
import org.hisrc.jscm.codemodel.literal.impl.BinaryOperatorImpl;
import org.hisrc.jscm.codemodel.operator.JSBinaryOperator;

public abstract class LogicalANDExpressionImpl extends LogicalORExpressionImpl
		implements JSLogicalANDExpression {

	public LogicalANDExpressionImpl(JSCodeModel codeModel) {
		super(codeModel);
	}

	@Override
	public And and(JSBitwiseORExpression value) {
		return new AndImpl(getCodeModel(), this, value);
	}

	public static class AndImpl extends LogicalANDExpressionImpl implements And {
		private final JSLogicalANDExpression left;

		private final JSBinaryOperator operator = new BinaryOperatorImpl("&&");

		private final JSBitwiseORExpression right;

		public AndImpl(JSCodeModel codeModel, JSLogicalANDExpression left,
				JSBitwiseORExpression right) {
			super(codeModel);
			Validate.notNull(left);
			Validate.notNull(right);
			this.left = left;
			this.right = right;

		}

		public JSLogicalANDExpression getLeft() {
			return left;
		}

		public JSBinaryOperator getOperator() {
			return operator;
		}

		public JSBitwiseORExpression getRight() {
			return right;
		}

		@Override
		public  V acceptExpressionVisitor(
				JSExpressionVisitor visitor) throws E {
			return visitor.visitAnd(this);
		}

	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy