|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.xtext.xbase.lib.IntegerExtensions
public class IntegerExtensions
This is an extension library for integral numbers
, e.g. int
or Integer
.
Nested Class Summary | |
---|---|
protected static class |
IntegerExtensions.IntIterator
Implementation of an iterator for integers. |
Constructor Summary | |
---|---|
IntegerExtensions()
|
Method Summary | |
---|---|
static int |
operator_divide(java.lang.Integer a,
java.lang.Number b)
The binary divide operator. |
static int |
operator_minus(java.lang.Integer a)
The unary minus operator. |
static int |
operator_minus(java.lang.Integer a,
java.lang.Number b)
The binary minus operator. |
static int |
operator_modulo(java.lang.Integer a,
java.lang.Number b)
The binary modulo operator. |
static int |
operator_multiply(java.lang.Integer a,
java.lang.Number b)
The binary times operator. |
static int |
operator_plus(java.lang.Integer a,
java.lang.Number b)
The binary plus operator. |
static int |
operator_power(java.lang.Integer a,
java.lang.Number b)
The power operator. |
static java.lang.Iterable<java.lang.Integer> |
operator_upTo(java.lang.Integer a,
java.lang.Number b)
The upTo operator yields an iterable of integral numbers from a up to b if b
is larger than a or otherwise from a down to b . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public IntegerExtensions()
Method Detail |
---|
public static int operator_minus(java.lang.Integer a)
minus
operator. This is the equivalent to the unary java -
operator.
a
- an integer. May not be null
.
-a
java.lang.NullPointerException
- if a
is null
.public static int operator_plus(java.lang.Integer a, java.lang.Number b)
plus
operator. This is the equivalent to the java +
operator.
a
- an integer. May not be null
.b
- a number. May not be null
.
a+b
java.lang.NullPointerException
- if a
or b
is null
.public static int operator_minus(java.lang.Integer a, java.lang.Number b)
minus
operator. This is the equivalent to the java -
operator.
a
- an integer. May not be null
.b
- a number. May not be null
.
a-b
java.lang.NullPointerException
- if a
or b
is null
.public static int operator_multiply(java.lang.Integer a, java.lang.Number b)
times
operator. This is the equivalent to the java *
operator.
a
- an integer. May not be null
.b
- a number. May not be null
.
a*b
java.lang.NullPointerException
- if a
or b
is null
.public static int operator_divide(java.lang.Integer a, java.lang.Number b)
divide
operator. This is the equivalent to the java /
operator. That is, the
result will be the integral result of the division, e.g. operator_divide(1, 2)
yields 0
.
a
- an integer. May not be null
.b
- a number. May not be null
.
a/b
java.lang.NullPointerException
- if a
or b
is null
.public static int operator_modulo(java.lang.Integer a, java.lang.Number b)
modulo
operator. This is the equivalent to the java %
operator.
a
- an integer. May not be null
.b
- a number. May not be null
.
a%b
java.lang.NullPointerException
- if a
or b
is null
.public static int operator_power(java.lang.Integer a, java.lang.Number b)
power
operator.
a
- an integer. May not be null
.b
- a number. May not be null
.
a ** b
java.lang.NullPointerException
- if a
or b
is null
.public static java.lang.Iterable<java.lang.Integer> operator_upTo(java.lang.Integer a, java.lang.Number b)
upTo
operator yields an iterable of integral numbers from a
up to b
if b
is larger than a
or otherwise from a
down to b
.
a
- an integer. May not be null
.b
- a number. May not be null
.
null
.
java.lang.NullPointerException
- if a
or b
is null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |