blob: f573d8847654c5e9d8d46835e394de7989f16211 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2011 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*******************************************************************************/
package org.eclipse.xtext.xbase.lib;
import com.google.common.annotations.GwtCompatible;
/**
* This is an extension library for {@link Integer integral numbers}, e.g. <code>int</code> or <code>Integer</code>.
*
* @author Sven Efftinge - Initial contribution and API
* @author Jan Koehnlein - Primitive versions
* @since 2.3
*/
@GwtCompatible public class IntegerExtensions {
/**
* The <code>..</code> operator yields an {@link IntegerRange}.
*
* @param a the start of the range.
* @param b the end of the range.
* @return an {@link IntegerRange}. Never <code>null</code>.
* @since 2.3
*/
@Pure
@Inline(value="new $3($1, $2)", imported=IntegerRange.class, statementExpression=false)
public static IntegerRange operator_upTo(final int a, final int b) {
return new IntegerRange(a, b);
}
/**
* The <code>..&lt;</code> operator yields an {@link ExclusiveRange} that increments from
* a to b (exclusive).
*
* @param a the start of the range.
* @param b the end of the range (exclusive).
* @return an incrementing {@link ExclusiveRange}. Never <code>null</code>.
* @since 2.4
*/
@Pure
@Inline(value="new $3($1, $2, true)", imported=ExclusiveRange.class, statementExpression=false)
public static ExclusiveRange operator_doubleDotLessThan(final int a, final int b) {
return new ExclusiveRange(a, b, true);
}
/**
* The <code>&gt;..</code> operator yields an {@link ExclusiveRange} that decrements from a
* (exclusive) down to b.
*
* @param a the start of the range (exclusive).
* @param b the end of the range.
* @return a decrementing {@link ExclusiveRange}. Never <code>null</code>.
* @since 2.4
*/
@Pure
@Inline(value="new $3($1, $2, false)", imported=ExclusiveRange.class, statementExpression=false)
public static ExclusiveRange operator_greaterThanDoubleDot(final int a, final int b) {
return new ExclusiveRange(a, b, false);
}
/**
* The bitwise inclusive <code>or</code> operation. This is the equivalent to the java <code>|</code> operator.
*
* @param a
* an integer.
* @param b
* an integer.
* @return <code>a|b</code>
*/
@Pure
@Inline(value="($1 | $2)", constantExpression=true)
public static int bitwiseOr(int a, int b) {
return a | b;
}
/**
* The bitwise exclusive <code>or</code> operation. This is the equivalent to the java <code>^</code> operator.
*
* @param a
* an integer.
* @param b
* an integer.
* @return <code>a^b</code>
*/
@Pure
@Inline(value="($1 ^ $2)", constantExpression=true)
public static int bitwiseXor(int a, int b) {
return a ^ b;
}
/**
* The bitwise <code>and</code> operation. This is the equivalent to the java <code>&amp;</code> operator.
*
* @param a
* an integer.
* @param b
* an integer.
* @return <code>a&amp;b</code>
*/
@Pure
@Inline(value="($1 & $2)", constantExpression=true)
public static int bitwiseAnd(int a, int b) {
return a & b;
}
/**
* The bitwise complement operation. This is the equivalent to the java <code>~</code> operator.
*
* @param a
* an integer.
* @return the bitwise complement of <code>a</code>.
*/
@Pure
@Inline(value="(~$1)", constantExpression=true)
public static int bitwiseNot(int a) {
return ~a;
}
/**
* The binary <code>signed left shift</code> operator. This is the equivalent to the java <code>&lt;&lt;</code> operator.
* Fills in a zero as the least significant bit.
*
* @param a
* an integer.
* @param distance
* the number of times to shift.
* @return <code>a&lt;&lt;distance</code>
* @deprecated use {@link #operator_doubleLessThan(int, int)} instead
*/
@Pure
@Inline(value="($1 << $2)", constantExpression=true)
@Deprecated
public static int shiftLeft(int a, int distance) {
return a << distance;
}
/**
* The binary <code>signed left shift</code> operator. This is the equivalent to the java <code>&lt;&lt;</code> operator.
* Fills in a zero as the least significant bit.
*
* @param a
* an integer.
* @param distance
* the number of times to shift.
* @return <code>a&lt;&lt;distance</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 << $2)", constantExpression=true)
public static int operator_doubleLessThan(int a, int distance) {
return a << distance;
}
/**
* The binary <code>signed right sift</code> operator. This is the equivalent to the java <code>&gt;&gt;</code> operator.
* Shifts in the value of the sign bit as the leftmost bit, thus preserving the sign of the initial value.
*
* @param a
* an integer.
* @param distance
* the number of times to shift.
* @return <code>a&gt;&gt;distance</code>
* @deprecated use {@link #operator_doubleGreaterThan(int, int)} instead
*/
@Pure
@Inline(value="($1 >> $2)", constantExpression=true)
@Deprecated
public static int shiftRight(int a, int distance) {
return a >> distance;
}
/**
* The binary <code>signed right sift</code> operator. This is the equivalent to the java <code>&gt;&gt;</code> operator.
* Shifts in the value of the sign bit as the leftmost bit, thus preserving the sign of the initial value.
*
* @param a
* an integer.
* @param distance
* the number of times to shift.
* @return <code>a&gt;&gt;distance</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >> $2)", constantExpression=true)
public static int operator_doubleGreaterThan(int a, int distance) {
return a >> distance;
}
/**
* The binary <code>unsigned right shift</code> operator. This is the equivalent to the java <code>&gt;&gt;&gt;</code> operator.
* Shifts in zeros into as leftmost bits, thus always yielding a positive integer.
*
* @param a
* an integer.
* @param distance
* the number of times to shift.
* @return <code>a&gt;&gt;&gt;distance</code>
* @deprecated use {@link #operator_tripleGreaterThan(int, int)} instead
*/
@Pure
@Inline(value="($1 >>> $2)", constantExpression=true)
@Deprecated
public static int shiftRightUnsigned(int a, int distance) {
return a >>> distance;
}
/**
* The binary <code>unsigned right shift</code> operator. This is the equivalent to the java <code>&gt;&gt;&gt;</code> operator.
* Shifts in zeros into as leftmost bits, thus always yielding a positive integer.
*
* @param a
* an integer.
* @param distance
* the number of times to shift.
* @return <code>a&gt;&gt;&gt;distance</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >>> $2)", constantExpression=true)
public static int operator_tripleGreaterThan(int a, int distance) {
return a >>> distance;
}
// BEGIN generated code
/**
* The unary <code>minus</code> operator. This is the equivalent to the Java's <code>-</code> function.
*
* @param i an integer.
* @return <code>-i</code>
* @since 2.3
*/
@Pure
@Inline(value="(-$1)", constantExpression=true)
public static int operator_minus(int i) {
return -i;
}
/**
* The postfix <code>decrement</code> operator. This is the equivalent to the Java's <code>--</code> postfix function.
*
* @param i an integer.
* @return <code>i--</code>
* @since 2.6
*/
@Inline(value="$1--")
public static int operator_minusMinus(int i) {
throw new HardcodedInInterpreterException();
}
/**
* The postfix <code>decrement</code> operator. This is the equivalent to the Java's <code>--</code> postfix function.
*
* @param i an integer.
* @return <code>i--</code>
* @since 2.6
*/
@Inline(value="$1--")
public static Integer operator_minusMinus(Integer i) {
throw new HardcodedInInterpreterException();
}
/**
* The postfix <code>increment</code> operator. This is the equivalent to the Java's <code>++</code> postfix function.
*
* @param i an integer.
* @return <code>i++</code>
* @since 2.6
*/
@Inline(value="$1++")
public static int operator_plusPlus(int i) {
throw new HardcodedInInterpreterException();
}
/**
* The postfix <code>increment</code> operator. This is the equivalent to the Java's <code>++</code> postfix function.
*
* @param i an integer.
* @return <code>i++</code>
* @since 2.6
*/
@Inline(value="$1++")
public static Integer operator_plusPlus(Integer i) {
throw new HardcodedInInterpreterException();
}
/**
* The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a+b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static double operator_plus(int a, double b) {
return a + b;
}
/**
* The binary <code>minus</code> operator. This is the equivalent to the Java <code>-</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a-b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 - $2)", constantExpression=true)
public static double operator_minus(int a, double b) {
return a - b;
}
/**
* The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a*b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static double operator_multiply(int a, double b) {
return a * b;
}
/**
* The binary <code>divide</code> operator. This is the equivalent to the Java <code>/</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a/b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 / $2)", constantExpression=true)
public static double operator_divide(int a, double b) {
return a / b;
}
/**
* The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a%b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 % $2)", constantExpression=true)
public static double operator_modulo(int a, double b) {
return a % b;
}
/**
* The binary <code>lessThan</code> operator. This is the equivalent to the Java <code>&lt;</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a&lt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(int a, double b) {
return a < b;
}
/**
* The binary <code>lessEqualsThan</code> operator. This is the equivalent to the Java <code>&lt;=</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a&lt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 <= $2)", constantExpression=true)
public static boolean operator_lessEqualsThan(int a, double b) {
return a <= b;
}
/**
* The binary <code>greaterThan</code> operator. This is the equivalent to the Java <code>&gt;</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a&gt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 > $2)", constantExpression=true)
public static boolean operator_greaterThan(int a, double b) {
return a > b;
}
/**
* The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>&gt;=</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a&gt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(int a, double b) {
return a >= b;
}
/**
* The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a==b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(int a, double b) {
return a == b;
}
/**
* The binary <code>notEquals</code> operator. This is the equivalent to the Java <code>!=</code> operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a!=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(int a, double b) {
return a != b;
}
/**
* The binary <code>power</code> operator. This is the equivalent to the Java's <code>Math.pow()</code> function.
*
* @param a an integer.
* @param b a double.
* @return <code>Math.pow(a, b)</code>
* @since 2.3
*/
@Pure
@Inline(value="$3.pow($1, $2)", imported=Math.class)
public static double operator_power(int a, double b) {
return Math.pow(a, b);
}
/**
* The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code>
* operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a == b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_tripleEquals(int a, double b) {
return a == b;
}
/**
* The <code>identity not equals</code> operator. This is the equivalent to Java's <code>!=</code>
* operator.
*
* @param a an integer.
* @param b a double.
* @return <code>a != b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_tripleNotEquals(int a, double b) {
return a != b;
}
/**
* The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a+b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static float operator_plus(int a, float b) {
return a + b;
}
/**
* The binary <code>minus</code> operator. This is the equivalent to the Java <code>-</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a-b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 - $2)", constantExpression=true)
public static float operator_minus(int a, float b) {
return a - b;
}
/**
* The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a*b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static float operator_multiply(int a, float b) {
return a * b;
}
/**
* The binary <code>divide</code> operator. This is the equivalent to the Java <code>/</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a/b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 / $2)", constantExpression=true)
public static float operator_divide(int a, float b) {
return a / b;
}
/**
* The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a%b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 % $2)", constantExpression=true)
public static float operator_modulo(int a, float b) {
return a % b;
}
/**
* The binary <code>lessThan</code> operator. This is the equivalent to the Java <code>&lt;</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a&lt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(int a, float b) {
return a < b;
}
/**
* The binary <code>lessEqualsThan</code> operator. This is the equivalent to the Java <code>&lt;=</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a&lt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 <= $2)", constantExpression=true)
public static boolean operator_lessEqualsThan(int a, float b) {
return a <= b;
}
/**
* The binary <code>greaterThan</code> operator. This is the equivalent to the Java <code>&gt;</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a&gt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 > $2)", constantExpression=true)
public static boolean operator_greaterThan(int a, float b) {
return a > b;
}
/**
* The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>&gt;=</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a&gt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(int a, float b) {
return a >= b;
}
/**
* The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a==b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(int a, float b) {
return a == b;
}
/**
* The binary <code>notEquals</code> operator. This is the equivalent to the Java <code>!=</code> operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a!=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(int a, float b) {
return a != b;
}
/**
* The binary <code>power</code> operator. This is the equivalent to the Java's <code>Math.pow()</code> function.
*
* @param a an integer.
* @param b a float.
* @return <code>Math.pow(a, b)</code>
* @since 2.3
*/
@Pure
@Inline(value="$3.pow($1, $2)", imported=Math.class)
public static double operator_power(int a, float b) {
return Math.pow(a, b);
}
/**
* The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code>
* operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a == b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_tripleEquals(int a, float b) {
return a == b;
}
/**
* The <code>identity not equals</code> operator. This is the equivalent to Java's <code>!=</code>
* operator.
*
* @param a an integer.
* @param b a float.
* @return <code>a != b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_tripleNotEquals(int a, float b) {
return a != b;
}
/**
* The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a+b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static long operator_plus(int a, long b) {
return a + b;
}
/**
* The binary <code>minus</code> operator. This is the equivalent to the Java <code>-</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a-b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 - $2)", constantExpression=true)
public static long operator_minus(int a, long b) {
return a - b;
}
/**
* The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a*b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static long operator_multiply(int a, long b) {
return a * b;
}
/**
* The binary <code>divide</code> operator. This is the equivalent to the Java <code>/</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a/b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 / $2)", constantExpression=true)
public static long operator_divide(int a, long b) {
return a / b;
}
/**
* The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a%b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 % $2)", constantExpression=true)
public static long operator_modulo(int a, long b) {
return a % b;
}
/**
* The binary <code>lessThan</code> operator. This is the equivalent to the Java <code>&lt;</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a&lt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(int a, long b) {
return a < b;
}
/**
* The binary <code>lessEqualsThan</code> operator. This is the equivalent to the Java <code>&lt;=</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a&lt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 <= $2)", constantExpression=true)
public static boolean operator_lessEqualsThan(int a, long b) {
return a <= b;
}
/**
* The binary <code>greaterThan</code> operator. This is the equivalent to the Java <code>&gt;</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a&gt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 > $2)", constantExpression=true)
public static boolean operator_greaterThan(int a, long b) {
return a > b;
}
/**
* The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>&gt;=</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a&gt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(int a, long b) {
return a >= b;
}
/**
* The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a==b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(int a, long b) {
return a == b;
}
/**
* The binary <code>notEquals</code> operator. This is the equivalent to the Java <code>!=</code> operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a!=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(int a, long b) {
return a != b;
}
/**
* The binary <code>power</code> operator. This is the equivalent to the Java's <code>Math.pow()</code> function.
*
* @param a an integer.
* @param b a long.
* @return <code>Math.pow(a, b)</code>
* @since 2.3
*/
@Pure
@Inline(value="$3.pow($1, $2)", imported=Math.class)
public static double operator_power(int a, long b) {
return Math.pow(a, b);
}
/**
* The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code>
* operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a == b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_tripleEquals(int a, long b) {
return a == b;
}
/**
* The <code>identity not equals</code> operator. This is the equivalent to Java's <code>!=</code>
* operator.
*
* @param a an integer.
* @param b a long.
* @return <code>a != b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_tripleNotEquals(int a, long b) {
return a != b;
}
/**
* The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a+b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static int operator_plus(int a, int b) {
return a + b;
}
/**
* The binary <code>minus</code> operator. This is the equivalent to the Java <code>-</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a-b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 - $2)", constantExpression=true)
public static int operator_minus(int a, int b) {
return a - b;
}
/**
* The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a*b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static int operator_multiply(int a, int b) {
return a * b;
}
/**
* The binary <code>divide</code> operator. This is the equivalent to the Java <code>/</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a/b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 / $2)", constantExpression=true)
public static int operator_divide(int a, int b) {
return a / b;
}
/**
* The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a%b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 % $2)", constantExpression=true)
public static int operator_modulo(int a, int b) {
return a % b;
}
/**
* The binary <code>lessThan</code> operator. This is the equivalent to the Java <code>&lt;</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a&lt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(int a, int b) {
return a < b;
}
/**
* The binary <code>lessEqualsThan</code> operator. This is the equivalent to the Java <code>&lt;=</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a&lt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 <= $2)", constantExpression=true)
public static boolean operator_lessEqualsThan(int a, int b) {
return a <= b;
}
/**
* The binary <code>greaterThan</code> operator. This is the equivalent to the Java <code>&gt;</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a&gt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 > $2)", constantExpression=true)
public static boolean operator_greaterThan(int a, int b) {
return a > b;
}
/**
* The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>&gt;=</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a&gt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(int a, int b) {
return a >= b;
}
/**
* The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a==b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(int a, int b) {
return a == b;
}
/**
* The binary <code>notEquals</code> operator. This is the equivalent to the Java <code>!=</code> operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a!=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(int a, int b) {
return a != b;
}
/**
* The binary <code>power</code> operator. This is the equivalent to the Java's <code>Math.pow()</code> function.
*
* @param a an integer.
* @param b an integer.
* @return <code>Math.pow(a, b)</code>
* @since 2.3
*/
@Pure
@Inline(value="$3.pow($1, $2)", imported=Math.class)
public static double operator_power(int a, int b) {
return Math.pow(a, b);
}
/**
* The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code>
* operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a == b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_tripleEquals(int a, int b) {
return a == b;
}
/**
* The <code>identity not equals</code> operator. This is the equivalent to Java's <code>!=</code>
* operator.
*
* @param a an integer.
* @param b an integer.
* @return <code>a != b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_tripleNotEquals(int a, int b) {
return a != b;
}
/**
* The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a+b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static int operator_plus(int a, char b) {
return a + b;
}
/**
* The binary <code>minus</code> operator. This is the equivalent to the Java <code>-</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a-b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 - $2)", constantExpression=true)
public static int operator_minus(int a, char b) {
return a - b;
}
/**
* The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a*b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static int operator_multiply(int a, char b) {
return a * b;
}
/**
* The binary <code>divide</code> operator. This is the equivalent to the Java <code>/</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a/b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 / $2)", constantExpression=true)
public static int operator_divide(int a, char b) {
return a / b;
}
/**
* The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a%b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 % $2)", constantExpression=true)
public static int operator_modulo(int a, char b) {
return a % b;
}
/**
* The binary <code>lessThan</code> operator. This is the equivalent to the Java <code>&lt;</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a&lt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(int a, char b) {
return a < b;
}
/**
* The binary <code>lessEqualsThan</code> operator. This is the equivalent to the Java <code>&lt;=</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a&lt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 <= $2)", constantExpression=true)
public static boolean operator_lessEqualsThan(int a, char b) {
return a <= b;
}
/**
* The binary <code>greaterThan</code> operator. This is the equivalent to the Java <code>&gt;</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a&gt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 > $2)", constantExpression=true)
public static boolean operator_greaterThan(int a, char b) {
return a > b;
}
/**
* The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>&gt;=</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a&gt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(int a, char b) {
return a >= b;
}
/**
* The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a==b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(int a, char b) {
return a == b;
}
/**
* The binary <code>notEquals</code> operator. This is the equivalent to the Java <code>!=</code> operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a!=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(int a, char b) {
return a != b;
}
/**
* The binary <code>power</code> operator. This is the equivalent to the Java's <code>Math.pow()</code> function.
*
* @param a an integer.
* @param b a character.
* @return <code>Math.pow(a, b)</code>
* @since 2.3
*/
@Pure
@Inline(value="$3.pow($1, $2)", imported=Math.class)
public static double operator_power(int a, char b) {
return Math.pow(a, b);
}
/**
* The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code>
* operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a == b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_tripleEquals(int a, char b) {
return a == b;
}
/**
* The <code>identity not equals</code> operator. This is the equivalent to Java's <code>!=</code>
* operator.
*
* @param a an integer.
* @param b a character.
* @return <code>a != b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_tripleNotEquals(int a, char b) {
return a != b;
}
/**
* The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a+b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static int operator_plus(int a, short b) {
return a + b;
}
/**
* The binary <code>minus</code> operator. This is the equivalent to the Java <code>-</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a-b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 - $2)", constantExpression=true)
public static int operator_minus(int a, short b) {
return a - b;
}
/**
* The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a*b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static int operator_multiply(int a, short b) {
return a * b;
}
/**
* The binary <code>divide</code> operator. This is the equivalent to the Java <code>/</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a/b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 / $2)", constantExpression=true)
public static int operator_divide(int a, short b) {
return a / b;
}
/**
* The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a%b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 % $2)", constantExpression=true)
public static int operator_modulo(int a, short b) {
return a % b;
}
/**
* The binary <code>lessThan</code> operator. This is the equivalent to the Java <code>&lt;</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a&lt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(int a, short b) {
return a < b;
}
/**
* The binary <code>lessEqualsThan</code> operator. This is the equivalent to the Java <code>&lt;=</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a&lt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 <= $2)", constantExpression=true)
public static boolean operator_lessEqualsThan(int a, short b) {
return a <= b;
}
/**
* The binary <code>greaterThan</code> operator. This is the equivalent to the Java <code>&gt;</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a&gt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 > $2)", constantExpression=true)
public static boolean operator_greaterThan(int a, short b) {
return a > b;
}
/**
* The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>&gt;=</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a&gt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(int a, short b) {
return a >= b;
}
/**
* The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a==b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(int a, short b) {
return a == b;
}
/**
* The binary <code>notEquals</code> operator. This is the equivalent to the Java <code>!=</code> operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a!=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(int a, short b) {
return a != b;
}
/**
* The binary <code>power</code> operator. This is the equivalent to the Java's <code>Math.pow()</code> function.
*
* @param a an integer.
* @param b a short.
* @return <code>Math.pow(a, b)</code>
* @since 2.3
*/
@Pure
@Inline(value="$3.pow($1, $2)", imported=Math.class)
public static double operator_power(int a, short b) {
return Math.pow(a, b);
}
/**
* The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code>
* operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a == b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_tripleEquals(int a, short b) {
return a == b;
}
/**
* The <code>identity not equals</code> operator. This is the equivalent to Java's <code>!=</code>
* operator.
*
* @param a an integer.
* @param b a short.
* @return <code>a != b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_tripleNotEquals(int a, short b) {
return a != b;
}
/**
* The binary <code>plus</code> operator. This is the equivalent to the Java <code>+</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a+b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 + $2)", constantExpression=true)
public static int operator_plus(int a, byte b) {
return a + b;
}
/**
* The binary <code>minus</code> operator. This is the equivalent to the Java <code>-</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a-b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 - $2)", constantExpression=true)
public static int operator_minus(int a, byte b) {
return a - b;
}
/**
* The binary <code>multiply</code> operator. This is the equivalent to the Java <code>*</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a*b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 * $2)", constantExpression=true)
public static int operator_multiply(int a, byte b) {
return a * b;
}
/**
* The binary <code>divide</code> operator. This is the equivalent to the Java <code>/</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a/b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 / $2)", constantExpression=true)
public static int operator_divide(int a, byte b) {
return a / b;
}
/**
* The binary <code>modulo</code> operator. This is the equivalent to the Java <code>%</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a%b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 % $2)", constantExpression=true)
public static int operator_modulo(int a, byte b) {
return a % b;
}
/**
* The binary <code>lessThan</code> operator. This is the equivalent to the Java <code>&lt;</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a&lt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 < $2)", constantExpression=true)
public static boolean operator_lessThan(int a, byte b) {
return a < b;
}
/**
* The binary <code>lessEqualsThan</code> operator. This is the equivalent to the Java <code>&lt;=</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a&lt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 <= $2)", constantExpression=true)
public static boolean operator_lessEqualsThan(int a, byte b) {
return a <= b;
}
/**
* The binary <code>greaterThan</code> operator. This is the equivalent to the Java <code>&gt;</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a&gt;b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 > $2)", constantExpression=true)
public static boolean operator_greaterThan(int a, byte b) {
return a > b;
}
/**
* The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>&gt;=</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a&gt;=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(int a, byte b) {
return a >= b;
}
/**
* The binary <code>equals</code> operator. This is the equivalent to the Java <code>==</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a==b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_equals(int a, byte b) {
return a == b;
}
/**
* The binary <code>notEquals</code> operator. This is the equivalent to the Java <code>!=</code> operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a!=b</code>
* @since 2.3
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_notEquals(int a, byte b) {
return a != b;
}
/**
* The binary <code>power</code> operator. This is the equivalent to the Java's <code>Math.pow()</code> function.
*
* @param a an integer.
* @param b a byte.
* @return <code>Math.pow(a, b)</code>
* @since 2.3
*/
@Pure
@Inline(value="$3.pow($1, $2)", imported=Math.class)
public static double operator_power(int a, byte b) {
return Math.pow(a, b);
}
/**
* The <code>identity equals</code> operator. This is the equivalent to Java's <code>==</code>
* operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a == b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 == $2)", constantExpression=true)
public static boolean operator_tripleEquals(int a, byte b) {
return a == b;
}
/**
* The <code>identity not equals</code> operator. This is the equivalent to Java's <code>!=</code>
* operator.
*
* @param a an integer.
* @param b a byte.
* @return <code>a != b</code>
* @since 2.4
*/
@Pure
@Inline(value="($1 != $2)", constantExpression=true)
public static boolean operator_tripleNotEquals(int a, byte b) {
return a != b;
}
// END generated code
}