|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Number
org.jscience.mathematics.number.Number<ModuloInteger>
org.jscience.mathematics.number.ModuloInteger
public final class ModuloInteger
This class represents a modulo integer. It can be used in conjonction
with the Matrix
class to resolve modulo equations (ref. number theory).
| Field Summary | |
|---|---|
static ModuloInteger |
ONE
The modulo integer representing the multiplicative identity. |
static ModuloInteger |
ZERO
The modulo integer representing the additive identity. |
| Method Summary | |
|---|---|
int |
compareTo(ModuloInteger that)
Compares this number with the specified number for order. |
ModuloInteger |
copy()
Returns a copy of this number allocated
by the calling thread (possibly on the stack). |
double |
doubleValue()
Returns the value of this number as a double. |
boolean |
equals(java.lang.Object that)
Compares this modulo integer against the specified object independently of the current modulus. |
static LargeInteger |
getModulus()
Returns the local modulus
for modular arithmetic or null if the arithmetic operations
are non-modular (default). |
int |
hashCode()
Returns the hash code for this large integer number. |
ModuloInteger |
inverse()
Returns the multiplicative inverse of this object. |
boolean |
isLargerThan(ModuloInteger that)
Compares the magnitude of this number with that number. |
long |
longValue()
Returns the value of this number as a long. |
LargeInteger |
moduloValue()
Returns the current modulo value of this number. |
ModuloInteger |
opposite()
Returns the additive inverse of this object. |
ModuloInteger |
plus(ModuloInteger that)
Returns the sum of this object with the one specified. |
static void |
setModulus(LargeInteger modulus)
Sets the local modulus
for modular arithmetic. |
ModuloInteger |
times(ModuloInteger that)
Returns the product of this object with the one specified. |
Text |
toText()
Returns the text representation of the current modulo value of this number. |
static ModuloInteger |
valueOf(java.lang.CharSequence chars)
Returns the modulo integer for the specified character sequence in decimal number. |
static ModuloInteger |
valueOf(LargeInteger value)
Returns the modulo integer having the specified value (independently of the current modulo). |
| Methods inherited from class org.jscience.mathematics.number.Number |
|---|
byteValue, floatValue, intValue, isGreaterThan, isLessThan, minus, pow, shortValue, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final ModuloInteger ZERO
public static final ModuloInteger ONE
| Method Detail |
|---|
public static ModuloInteger valueOf(LargeInteger value)
value - the modulo integer intrinsic value.
public static ModuloInteger valueOf(java.lang.CharSequence chars)
chars - the character sequence.
public static LargeInteger getModulus()
local modulus
for modular arithmetic or null if the arithmetic operations
are non-modular (default).
null if none.setModulus(org.jscience.mathematics.number.LargeInteger)public static void setModulus(LargeInteger modulus)
local modulus
for modular arithmetic.
modulus - the new modulus or null to unset the modulus.
java.lang.IllegalArgumentException - if modulus <= 0public LargeInteger moduloValue()
set to null the intrinsic value
(the creation value) is returned.
public Text toText()
toText in interface RealtimetoText in class Number<ModuloInteger>public boolean equals(java.lang.Object that)
equals in class Number<ModuloInteger>that - the object to compare with.
true if that is a modulo number with the same
intrinsic value; false otherwise.public int hashCode()
hashCode in class Number<ModuloInteger>public boolean isLargerThan(ModuloInteger that)
Number
isLargerThan in class Number<ModuloInteger>|this| > |that|public long longValue()
Numberlong.
longValue in class Number<ModuloInteger>long.public double doubleValue()
Numberdouble.
doubleValue in class Number<ModuloInteger>double.public int compareTo(ModuloInteger that)
Number(x.compareTo(y)==0) == (x.equals(y)),
compareTo in interface java.lang.Comparable<ModuloInteger>compareTo in class Number<ModuloInteger>that - the number to be compared.
public ModuloInteger times(ModuloInteger that)
Ring
times in interface GroupMultiplicative<ModuloInteger>times in interface Ring<ModuloInteger>that - the object multiplier.
this ยท that.public ModuloInteger plus(ModuloInteger that)
GroupAdditive
plus in interface GroupAdditive<ModuloInteger>that - the object to be added.
this + that.public ModuloInteger opposite()
GroupAdditivethis.plus(this.opposite()) == ZERO,
with ZERO being the additive identity.
opposite in interface GroupAdditive<ModuloInteger>-this.public ModuloInteger inverse()
GroupMultiplicativethis.times(this.inverse()) == ONE ,
with ONE being the multiplicative identity.
inverse in interface GroupMultiplicative<ModuloInteger>ONE / this.public ModuloInteger copy()
Numberallocated
by the calling thread (possibly on the stack).
copy in interface ValueTypecopy in class Number<ModuloInteger>
|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||