|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Number
org.jscience.mathematics.algebraic.numbers.ComparableNumber<Integer>
org.jscience.mathematics.algebraic.numbers.Integer
public final class Integer
The Integer class encapsulates integer numbers.
IntegerRing,
Serialized Form| Field Summary | |
|---|---|
static int |
MAX_VALUE
DOCUMENT ME! |
static int |
MIN_VALUE
DOCUMENT ME! |
static int |
NEGATIVE_INFINITY
DOCUMENT ME! |
static Integer |
ONE
DOCUMENT ME! |
static int |
POSITIVE_INFINITY
DOCUMENT ME! |
static java.lang.Class |
TYPE
DOCUMENT ME! |
static Integer |
ZERO
DOCUMENT ME! |
| Constructor Summary | |
|---|---|
Integer(int num)
Constructs an integer number. |
|
Integer(Integer num)
Constructs an integer number. |
|
Integer(java.lang.String s)
Constructs the integer number represented by a string. |
|
| Method Summary | |
|---|---|
Integer |
abs()
Returns the abs of this number. |
AbelianGroup.Member |
add(AbelianGroup.Member n)
Returns the addition of this number and another. |
Integer |
add(Integer n)
Returns the addition of this integer number and another. |
java.lang.Object |
clone()
DOCUMENT ME! |
int |
compareTo(ComparableNumber obj)
Compares two comparable numbers. |
int |
compareTo(Integer obj)
Compares two integer numbers. |
double |
doubleValue()
DOCUMENT ME! |
boolean |
equals(java.lang.Object obj)
Compares two integer numbers for equality. |
float |
floatValue()
DOCUMENT ME! |
Integer |
gcd(Integer val)
|
Integer |
getDistance(ComparableNumber n)
DOCUMENT ME! |
Integer |
getNaN()
DOCUMENT ME! |
Integer |
getNegativeInfinity()
DOCUMENT ME! |
Integer |
getPositiveInfinity()
DOCUMENT ME! |
int |
hashCode()
Returns a hash code for this Integer object. |
Integer |
integerDivision(Integer val)
DOCUMENT ME! |
int |
intValue()
DOCUMENT ME! |
boolean |
isEven()
Returns true if this number is even. |
boolean |
isInfinite()
Returns true if this number is infinite. |
boolean |
isNaN()
Returns true if this number is NaN. |
boolean |
isNegativeInfinity()
DOCUMENT ME! |
boolean |
isOdd()
Returns true if this number is odd. |
boolean |
isPositiveInfinity()
DOCUMENT ME! |
Integer |
lcm(Integer val)
|
long |
longValue()
DOCUMENT ME! |
Integer |
max(Integer val)
Returns the max of this number and another, according to compareTo rules. |
Integer |
min(Integer val)
Returns the min of this number and another, according to compareTo rules. |
Integer |
multiply(Integer n)
Returns the multiplication of this integer number and another. |
Ring.Member |
multiply(Ring.Member n)
Returns the multiplication of this number and another. |
AbelianGroup.Member |
negate()
Returns the negative of this number. |
Integer |
pow(Integer n)
Returns this integer number raised to the power of another. |
Integer |
remainder(Integer val)
DOCUMENT ME! |
int |
signum()
Returns the sign of this number. |
AbelianGroup.Member |
subtract(AbelianGroup.Member n)
Returns the subtraction of this number and another. |
Integer |
subtract(Integer n)
Returns the subtraction of this integer number and another. |
java.lang.String |
toString()
Returns a string representing the value of this integer number. |
int |
value()
Returns the integer value. |
| Methods inherited from class java.lang.Number |
|---|
byteValue, shortValue |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Integer ZERO
public static final Integer ONE
public static final int MAX_VALUE
public static final int MIN_VALUE
public static final int NEGATIVE_INFINITY
public static final int POSITIVE_INFINITY
public static final java.lang.Class TYPE
| Constructor Detail |
|---|
public Integer(int num)
public Integer(Integer num)
public Integer(java.lang.String s)
throws java.lang.NumberFormatException
s - a string representing an integer number.
java.lang.NumberFormatException - if the string does not contain a parsable number.| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - an integer number.
public int compareTo(ComparableNumber obj)
throws java.lang.IllegalArgumentException
obj - a number.
this<obj, zero if
this==obj, and a positive value if
this>obj.
java.lang.IllegalArgumentException - DOCUMENT ME!
public int compareTo(Integer obj)
throws java.lang.IllegalArgumentException
compareTo in interface java.lang.Comparable<Integer>obj - an integer number.
this<obj, zero if
this==obj, and a positive value if
this>obj.
java.lang.IllegalArgumentException - DOCUMENT ME!public java.lang.String toString()
toString in class java.lang.Objectpublic int value()
public int intValue()
intValue in class java.lang.Numberpublic long longValue()
longValue in class java.lang.Numberpublic float floatValue()
floatValue in class java.lang.Numberpublic double doubleValue()
doubleValue in class java.lang.Numberpublic boolean isEven()
public boolean isOdd()
public Integer abs()
public int signum()
public Integer min(Integer val)
min in class ComparableNumber<Integer>val - DOCUMENT ME!
public Integer max(Integer val)
max in class ComparableNumber<Integer>val - DOCUMENT ME!
public int hashCode()
hashCode in class java.lang.Objectpublic boolean isNaN()
isNaN in class ComparableNumber<Integer>public boolean isInfinite()
isInfinite in class ComparableNumber<Integer>public boolean isNegativeInfinity()
isNegativeInfinity in class ComparableNumber<Integer>public boolean isPositiveInfinity()
isPositiveInfinity in class ComparableNumber<Integer>public Integer getNaN()
getNaN in class ComparableNumber<Integer>public Integer getNegativeInfinity()
getNegativeInfinity in class ComparableNumber<Integer>public Integer getPositiveInfinity()
getPositiveInfinity in class ComparableNumber<Integer>public Integer getDistance(ComparableNumber n)
getDistance in class ComparableNumber<Integer>n - DOCUMENT ME!
public AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic AbelianGroup.Member add(AbelianGroup.Member n)
add in interface AbelianGroup.Membern - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public Integer add(Integer n)
n - DOCUMENT ME!
public AbelianGroup.Member subtract(AbelianGroup.Member n)
subtract in interface AbelianGroup.Membern - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public Integer subtract(Integer n)
n - an integer number.
public Ring.Member multiply(Ring.Member n)
multiply in interface Ring.Membern - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public Integer multiply(Integer n)
n - an integer number.
public Integer pow(Integer n)
n - an integer number.
public Integer gcd(Integer val)
public Integer lcm(Integer val)
public Integer integerDivision(Integer val)
val - DOCUMENT ME!
public Integer remainder(Integer val)
val - DOCUMENT ME!
public java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||