|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Number
JSci.maths.MathInteger
public final class MathInteger
The MathInteger class encapsulates integer numbers.
IntegerRing,
Serialized Form| Constructor Summary | |
|---|---|
MathInteger(int num)
Constructs an integer number. |
|
MathInteger(java.lang.String s)
Constructs the integer number represented by a string. |
|
| Method Summary | |
|---|---|
AbelianGroup.Member |
add(AbelianGroup.Member n)
Returns the addition of this number and another. |
MathInteger |
add(int y)
|
MathInteger |
add(MathInteger n)
Returns the addition of this integer number and another. |
int |
compareTo(java.lang.Object obj)
Compares two integer numbers. |
double |
doubleValue()
|
boolean |
equals(java.lang.Object obj)
Compares two integer numbers for equality. |
float |
floatValue()
|
java.lang.Object |
getSet()
|
int |
hashCode()
|
int |
intValue()
|
boolean |
isEven()
Returns true if this number is even. |
boolean |
isOdd()
Returns true if this number is odd. |
long |
longValue()
|
MathInteger |
multiply(int y)
|
MathInteger |
multiply(MathInteger 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. |
MathInteger |
pow(MathInteger n)
Returns this integer number raised to the power of another. |
AbelianGroup.Member |
subtract(AbelianGroup.Member n)
Returns the subtraction of this number and another. |
MathInteger |
subtract(int y)
|
MathInteger |
subtract(MathInteger 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 |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public MathInteger(int num)
public MathInteger(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 hashCode()
hashCode in class java.lang.Object
public int compareTo(java.lang.Object obj)
throws java.lang.IllegalArgumentException
compareTo in interface java.lang.Comparableobj - an integer number.
this<obj,
zero if this==obj,
and a positive value if this>obj.
java.lang.IllegalArgumentExceptionpublic 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 java.lang.Object getSet()
getSet in interface Memberpublic AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic AbelianGroup.Member add(AbelianGroup.Member n)
add in interface AbelianGroup.Membern - a group memberpublic MathInteger add(MathInteger n)
public MathInteger add(int y)
public AbelianGroup.Member subtract(AbelianGroup.Member n)
subtract in interface AbelianGroup.Membern - a group memberpublic MathInteger subtract(MathInteger n)
n - an integer number.public MathInteger subtract(int y)
public Ring.Member multiply(Ring.Member n)
multiply in interface Ring.Membern - a ring memberpublic MathInteger multiply(MathInteger n)
n - an integer number.public MathInteger multiply(int y)
public MathInteger pow(MathInteger n)
n - an integer number.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||