2 * Copyright (c) 2018 Pantheon Technologies, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.xpath.api;
10 import static java.util.Objects.requireNonNull;
12 import com.google.common.annotations.Beta;
15 * YANG XPath binary operator.
17 * @author Robert Varga
20 public enum YangBinaryOperator {
24 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-EqualityExpr">EqualityExpr</a>
28 * Operands do not equal.
30 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-EqualityExpr">EqualityExpr</a>
35 * Left-hand operand is greater than right-hand operand.
37 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
41 * Left-hand operand is greater than or equal to right-hand operand.
43 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
47 * Left-hand operand is less than right-hand operand.
49 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
53 * Left-hand operand is less than or equal to right-hand operand.
55 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-RelationalExpr">RelationalExpr</a>
60 * Arithmetic addition.
62 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-AdditiveExpr">AdditiveExpr</a>
66 * Arithmetic subtraction.
68 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-AdditiveExpr">AdditiveExpr</a>
73 * Arithmetic multiplication.
75 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-MultiplicativeExpr">MultiplicativeExpr</a>
79 * Arithmetic division.
81 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-MultiplicativeExpr">MultiplicativeExpr</a>
85 * Arithmetic modulus after truncating division.
87 * @see <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#NT-MultiplicativeExpr">MultiplicativeExpr</a>
91 private final class Expr extends YangBinaryExpr {
92 private static final long serialVersionUID = 1L;
94 Expr(final YangExpr leftExpr, final YangExpr rightExpr) {
95 super(leftExpr, rightExpr);
99 public YangBinaryOperator getOperator() {
100 return YangBinaryOperator.this;
104 private final String str;
106 YangBinaryOperator(final String str) {
107 this.str = requireNonNull(str);
111 public String toString() {
115 public YangBinaryExpr exprWith(final YangExpr leftExpr, final YangExpr rightExpr) {
116 return new Expr(leftExpr, rightExpr);