Top Description Constructors Methods
org.eclipse.xtext.xbase.lib

public Class IntegerExtensions

extends Object
Class Inheritance
Annotations
@GwtCompatible
Imports
com.google.common.annotations.GwtCompatible

This is an extension library for integral numbers, e.g. int or Integer.
Authors
Sven Efftinge - Initial contribution and API, Jan Koehnlein - Primitive versions
Since
2.3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int

Returns:

a&b
bitwiseAnd
(int
an integer.
a
,
int
an integer.
b
)

The bitwise and operation.

public static int

Returns:

the bitwise complement of a.
bitwiseNot
(int
an integer.
a
)

The bitwise complement operation.

public static int

Returns:

a|b
bitwiseOr
(int
an integer.
a
,
int
an integer.
b
)

The bitwise inclusive or operation.

public static int

Returns:

a^b
bitwiseXor
(int
an integer.
a
,
int
an integer.
b
)

The bitwise exclusive or operation.

public static double

Returns:

a/b
operator_divide
(int
an integer.
a
,
double
a double.
b
)

The binary divide operator.

public static float

Returns:

a/b
operator_divide
(int
an integer.
a
,
float
a float.
b
)

The binary divide operator.

public static long

Returns:

a/b
operator_divide
(int
an integer.
a
,
long
a long.
b
)

The binary divide operator.

public static int

Returns:

a/b
operator_divide
(int
an integer.
a
,
int
an integer.
b
)

The binary divide operator.

public static int

Returns:

a/b
operator_divide
(int
an integer.
a
,
char
a character.
b
)

The binary divide operator.

public static int

Returns:

a/b
operator_divide
(int
an integer.
a
,
short
a short.
b
)

The binary divide operator.

public static int

Returns:

a/b
operator_divide
(int
an integer.
a
,
byte
a byte.
b
)

The binary divide operator.

public static ExclusiveRange

Returns:

an incrementing ExclusiveRange. Never null.
operator_doubleDotLessThan
(final int
the start of the range.
a
,
final int
the end of the range (exclusive).
b
)

The ..

public static int

Returns:

a>>distance
operator_doubleGreaterThan
(int
an integer.
a
,
int
the number of times to shift.
distance
)

The binary signed right sift operator.

public static int

Returns:

a<<distance
operator_doubleLessThan
(int
an integer.
a
,
int
the number of times to shift.
distance
)

The binary signed left shift operator.

public static boolean

Returns:

a==b
operator_equals
(int
an integer.
a
,
double
a double.
b
)

The binary equals operator.

public static boolean

Returns:

a==b
operator_equals
(int
an integer.
a
,
float
a float.
b
)

The binary equals operator.

public static boolean

Returns:

a==b
operator_equals
(int
an integer.
a
,
long
a long.
b
)

The binary equals operator.

public static boolean

Returns:

a==b
operator_equals
(int
an integer.
a
,
int
an integer.
b
)

The binary equals operator.

public static boolean

Returns:

a==b
operator_equals
(int
an integer.
a
,
char
a character.
b
)

The binary equals operator.

public static boolean

Returns:

a==b
operator_equals
(int
an integer.
a
,
short
a short.
b
)

The binary equals operator.

public static boolean

Returns:

a==b
operator_equals
(int
an integer.
a
,
byte
a byte.
b
)

The binary equals operator.

public static boolean

Returns:

a>=b
operator_greaterEqualsThan
(int
an integer.
a
,
double
a double.
b
)

The binary greaterEqualsThan operator.

public static boolean

Returns:

a>=b
operator_greaterEqualsThan
(int
an integer.
a
,
float
a float.
b
)

The binary greaterEqualsThan operator.

public static boolean

Returns:

a>=b
operator_greaterEqualsThan
(int
an integer.
a
,
long
a long.
b
)

The binary greaterEqualsThan operator.

public static boolean

Returns:

a>=b
operator_greaterEqualsThan
(int
an integer.
a
,
int
an integer.
b
)

The binary greaterEqualsThan operator.

public static boolean

Returns:

a>=b
operator_greaterEqualsThan
(int
an integer.
a
,
char
a character.
b
)

The binary greaterEqualsThan operator.

public static boolean

Returns:

a>=b
operator_greaterEqualsThan
(int
an integer.
a
,
short
a short.
b
)

The binary greaterEqualsThan operator.

public static boolean

Returns:

a>=b
operator_greaterEqualsThan
(int
an integer.
a
,
byte
a byte.
b
)

The binary greaterEqualsThan operator.

public static boolean

Returns:

a>b
operator_greaterThan
(int
an integer.
a
,
double
a double.
b
)

The binary greaterThan operator.

public static boolean

Returns:

a>b
operator_greaterThan
(int
an integer.
a
,
float
a float.
b
)

The binary greaterThan operator.

public static boolean

Returns:

a>b
operator_greaterThan
(int
an integer.
a
,
long
a long.
b
)

The binary greaterThan operator.

public static boolean

Returns:

a>b
operator_greaterThan
(int
an integer.
a
,
int
an integer.
b
)

The binary greaterThan operator.

public static boolean

Returns:

a>b
operator_greaterThan
(int
an integer.
a
,
char
a character.
b
)

The binary greaterThan operator.

public static boolean

Returns:

a>b
operator_greaterThan
(int
an integer.
a
,
short
a short.
b
)

The binary greaterThan operator.

public static boolean

Returns:

a>b
operator_greaterThan
(int
an integer.
a
,
byte
a byte.
b
)

The binary greaterThan operator.

public static ExclusiveRange

Returns:

a decrementing ExclusiveRange. Never null.
operator_greaterThanDoubleDot
(final int
the start of the range (exclusive).
a
,
final int
the end of the range.
b
)

The >..

public static boolean

Returns:

a<=b
operator_lessEqualsThan
(int
an integer.
a
,
double
a double.
b
)

The binary lessEqualsThan operator.

public static boolean

Returns:

a<=b
operator_lessEqualsThan
(int
an integer.
a
,
float
a float.
b
)

The binary lessEqualsThan operator.

public static boolean

Returns:

a<=b
operator_lessEqualsThan
(int
an integer.
a
,
long
a long.
b
)

The binary lessEqualsThan operator.

public static boolean

Returns:

a<=b
operator_lessEqualsThan
(int
an integer.
a
,
int
an integer.
b
)

The binary lessEqualsThan operator.

public static boolean

Returns:

a<=b
operator_lessEqualsThan
(int
an integer.
a
,
char
a character.
b
)

The binary lessEqualsThan operator.

public static boolean

Returns:

a<=b
operator_lessEqualsThan
(int
an integer.
a
,
short
a short.
b
)

The binary lessEqualsThan operator.

public static boolean

Returns:

a<=b
operator_lessEqualsThan
(int
an integer.
a
,
byte
a byte.
b
)

The binary lessEqualsThan operator.

public static boolean

Returns:

a<b
operator_lessThan
(int
an integer.
a
,
double
a double.
b
)

The binary lessThan operator.

public static boolean

Returns:

a<b
operator_lessThan
(int
an integer.
a
,
float
a float.
b
)

The binary lessThan operator.

public static boolean

Returns:

a<b
operator_lessThan
(int
an integer.
a
,
long
a long.
b
)

The binary lessThan operator.

public static boolean

Returns:

a<b
operator_lessThan
(int
an integer.
a
,
int
an integer.
b
)

The binary lessThan operator.

public static boolean

Returns:

a<b
operator_lessThan
(int
an integer.
a
,
char
a character.
b
)

The binary lessThan operator.

public static boolean

Returns:

a<b
operator_lessThan
(int
an integer.
a
,
short
a short.
b
)

The binary lessThan operator.

public static boolean

Returns:

a<b
operator_lessThan
(int
an integer.
a
,
byte
a byte.
b
)

The binary lessThan operator.

public static int

Returns:

-i
operator_minus
(int
an integer.
i
)

The unary minus operator.

public static double

Returns:

a-b
operator_minus
(int
an integer.
a
,
double
a double.
b
)

The binary minus operator.

public static float

Returns:

a-b
operator_minus
(int
an integer.
a
,
float
a float.
b
)

The binary minus operator.

public static long

Returns:

a-b
operator_minus
(int
an integer.
a
,
long
a long.
b
)

The binary minus operator.

public static int

Returns:

a-b
operator_minus
(int
an integer.
a
,
int
an integer.
b
)

The binary minus operator.

public static int

Returns:

a-b
operator_minus
(int
an integer.
a
,
char
a character.
b
)

The binary minus operator.

public static int

Returns:

a-b
operator_minus
(int
an integer.
a
,
short
a short.
b
)

The binary minus operator.

public static int

Returns:

a-b
operator_minus
(int
an integer.
a
,
byte
a byte.
b
)

The binary minus operator.

public static int

Returns:

i--
operator_minusMinus
(int
an integer.
i
)

The postfix decrement operator.

public static Integer

Returns:

i--
operator_minusMinus
(Integer
an integer.
i
)

The postfix decrement operator.

public static double

Returns:

a%b
operator_modulo
(int
an integer.
a
,
double
a double.
b
)

The binary modulo operator.

public static float

Returns:

a%b
operator_modulo
(int
an integer.
a
,
float
a float.
b
)

The binary modulo operator.

public static long

Returns:

a%b
operator_modulo
(int
an integer.
a
,
long
a long.
b
)

The binary modulo operator.

public static int

Returns:

a%b
operator_modulo
(int
an integer.
a
,
int
an integer.
b
)

The binary modulo operator.

public static int

Returns:

a%b
operator_modulo
(int
an integer.
a
,
char
a character.
b
)

The binary modulo operator.

public static int

Returns:

a%b
operator_modulo
(int
an integer.
a
,
short
a short.
b
)

The binary modulo operator.

public static int

Returns:

a%b
operator_modulo
(int
an integer.
a
,
byte
a byte.
b
)

The binary modulo operator.

public static double

Returns:

a*b
operator_multiply
(int
an integer.
a
,
double
a double.
b
)

The binary multiply operator.

public static float

Returns:

a*b
operator_multiply
(int
an integer.
a
,
float
a float.
b
)

The binary multiply operator.

public static long

Returns:

a*b
operator_multiply
(int
an integer.
a
,
long
a long.
b
)

The binary multiply operator.

public static int

Returns:

a*b
operator_multiply
(int
an integer.
a
,
int
an integer.
b
)

The binary multiply operator.

public static int

Returns:

a*b
operator_multiply
(int
an integer.
a
,
char
a character.
b
)

The binary multiply operator.

public static int

Returns:

a*b
operator_multiply
(int
an integer.
a
,
short
a short.
b
)

The binary multiply operator.

public static int

Returns:

a*b
operator_multiply
(int
an integer.
a
,
byte
a byte.
b
)

The binary multiply operator.

public static boolean

Returns:

a!=b
operator_notEquals
(int
an integer.
a
,
double
a double.
b
)

The binary notEquals operator.

public static boolean

Returns:

a!=b
operator_notEquals
(int
an integer.
a
,
float
a float.
b
)

The binary notEquals operator.

public static boolean

Returns:

a!=b
operator_notEquals
(int
an integer.
a
,
long
a long.
b
)

The binary notEquals operator.

public static boolean

Returns:

a!=b
operator_notEquals
(int
an integer.
a
,
int
an integer.
b
)

The binary notEquals operator.

public static boolean

Returns:

a!=b
operator_notEquals
(int
an integer.
a
,
char
a character.
b
)

The binary notEquals operator.

public static boolean

Returns:

a!=b
operator_notEquals
(int
an integer.
a
,
short
a short.
b
)

The binary notEquals operator.

public static boolean

Returns:

a!=b
operator_notEquals
(int
an integer.
a
,
byte
a byte.
b
)

The binary notEquals operator.

public static double

Returns:

a+b
operator_plus
(int
an integer.
a
,
double
a double.
b
)

The binary plus operator.

public static float

Returns:

a+b
operator_plus
(int
an integer.
a
,
float
a float.
b
)

The binary plus operator.

public static long

Returns:

a+b
operator_plus
(int
an integer.
a
,
long
a long.
b
)

The binary plus operator.

public static int

Returns:

a+b
operator_plus
(int
an integer.
a
,
int
an integer.
b
)

The binary plus operator.

public static int

Returns:

a+b
operator_plus
(int
an integer.
a
,
char
a character.
b
)

The binary plus operator.

public static int

Returns:

a+b
operator_plus
(int
an integer.
a
,
short
a short.
b
)

The binary plus operator.

public static int

Returns:

a+b
operator_plus
(int
an integer.
a
,
byte
a byte.
b
)

The binary plus operator.

public static int

Returns:

i++
operator_plusPlus
(int
an integer.
i
)

The postfix increment operator.

public static Integer

Returns:

i++
operator_plusPlus
(Integer
an integer.
i
)

The postfix increment operator.

public static double

Returns:

Math.pow(a, b)
operator_power
(int
an integer.
a
,
double
a double.
b
)

The binary power operator.

public static double

Returns:

Math.pow(a, b)
operator_power
(int
an integer.
a
,
float
a float.
b
)

The binary power operator.

public static double

Returns:

Math.pow(a, b)
operator_power
(int
an integer.
a
,
long
a long.
b
)

The binary power operator.

public static double

Returns:

Math.pow(a, b)
operator_power
(int
an integer.
a
,
int
an integer.
b
)

The binary power operator.

public static double

Returns:

Math.pow(a, b)
operator_power
(int
an integer.
a
,
char
a character.
b
)

The binary power operator.

public static double

Returns:

Math.pow(a, b)
operator_power
(int
an integer.
a
,
short
a short.
b
)

The binary power operator.

public static double

Returns:

Math.pow(a, b)
operator_power
(int
an integer.
a
,
byte
a byte.
b
)

The binary power operator.

public static boolean

Returns:

a == b
operator_tripleEquals
(int
an integer.
a
,
double
a double.
b
)

The identity equals operator.

public static boolean

Returns:

a == b
operator_tripleEquals
(int
an integer.
a
,
float
a float.
b
)

The identity equals operator.

public static boolean

Returns:

a == b
operator_tripleEquals
(int
an integer.
a
,
long
a long.
b
)

The identity equals operator.

public static boolean

Returns:

a == b
operator_tripleEquals
(int
an integer.
a
,
int
an integer.
b
)

The identity equals operator.

public static boolean

Returns:

a == b
operator_tripleEquals
(int
an integer.
a
,
char
a character.
b
)

The identity equals operator.

public static boolean

Returns:

a == b
operator_tripleEquals
(int
an integer.
a
,
short
a short.
b
)

The identity equals operator.

public static boolean

Returns:

a == b
operator_tripleEquals
(int
an integer.
a
,
byte
a byte.
b
)

The identity equals operator.

public static int

Returns:

a>>>distance
operator_tripleGreaterThan
(int
an integer.
a
,
int
the number of times to shift.
distance
)

The binary unsigned right shift operator.

public static boolean

Returns:

a != b
operator_tripleNotEquals
(int
an integer.
a
,
double
a double.
b
)

The identity not equals operator.

public static boolean

Returns:

a != b
operator_tripleNotEquals
(int
an integer.
a
,
float
a float.
b
)

The identity not equals operator.

public static boolean

Returns:

a != b
operator_tripleNotEquals
(int
an integer.
a
,
long
a long.
b
)

The identity not equals operator.

public static boolean

Returns:

a != b
operator_tripleNotEquals
(int
an integer.
a
,
int
an integer.
b
)

The identity not equals operator.

public static boolean

Returns:

a != b
operator_tripleNotEquals
(int
an integer.
a
,
char
a character.
b
)

The identity not equals operator.

public static boolean

Returns:

a != b
operator_tripleNotEquals
(int
an integer.
a
,
short
a short.
b
)

The identity not equals operator.

public static boolean

Returns:

a != b
operator_tripleNotEquals
(int
an integer.
a
,
byte
a byte.
b
)

The identity not equals operator.

public static IntegerRange

Returns:

an IntegerRange. Never null.
operator_upTo
(final int
the start of the range.
a
,
final int
the end of the range.
b
)

The ..

public static int

Returns:

a<<distance
shiftLeft
(int
an integer.
a
,
int
the number of times to shift.
distance
)
Deprecated use operator_doubleLessThan(int, int) instead

The binary signed left shift operator.

public static int

Returns:

a>>distance
shiftRight
(int
an integer.
a
,
int
the number of times to shift.
distance
)
Deprecated use operator_doubleGreaterThan(int, int) instead

The binary signed right sift operator.

public static int

Returns:

a>>>distance
shiftRightUnsigned
(int
an integer.
a
,
int
the number of times to shift.
distance
)
Deprecated use operator_tripleGreaterThan(int, int) instead

The binary unsigned right shift operator.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait