|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
com.dautelle.math.numbers.RealtimeNumber
com.dautelle.math.numbers.Integer64
This class represents a 64 bits signed integer.
This class implements the Operable
interface for modular
arithmetic (ref. setModulus(com.dautelle.math.numbers.Integer64)
).
Nested Class Summary | |
static class |
Integer64.Value
This inner class represents a mutable image of an immutable Integer64 . |
Nested classes inherited from class com.dautelle.math.numbers.RealtimeNumber |
RealtimeNumber.Factory |
Field Summary | |
static Integer64 |
ONE
The 64 bits integer one. |
static Integer64 |
ZERO
The 64 bits integer representing zero. |
Method Summary | |
Integer64 |
abs()
Returns the absolute value of this number. |
Integer64 |
add(Integer64 that)
Returns the sum of this number with the one specified. |
java.lang.StringBuffer |
appendTo(java.lang.StringBuffer sb)
Appends the decimal text representation of this number to the StringBuffer argument. |
int |
compareTo(Integer64 that)
Compares two 64 bits integer numerically. |
int |
compareTo(java.lang.Object that)
|
Integer64 |
divide(Integer64 that)
Returns this number divided by the one specified. |
double |
doubleValue()
Returns the value of this number as a double . |
boolean |
equals(java.lang.Object that)
Compares this number against the specified object. |
float |
floatValue()
Returns the value of this number as a float . |
int |
hashCode()
Returns the hash code for this number. |
int |
intValue()
Returns the value of this number as an int . |
long |
longValue()
Returns the value of this number as a long . |
Integer64 |
mod(Integer64 m)
Returns this number modulo the specified number. |
Integer64 |
multiply(Integer64 that)
Returns the product of this number with the one specified. |
Integer64 |
negate()
Returns the negation of this number. |
Operable |
opposite()
Returns the additive inverse of this object. |
Operable |
plus(Operable that)
Returns the sum of this object with the one specified. |
Operable |
reciprocal()
Returns the multiplicative inverse of this object. |
static void |
setModulus(Integer64 modulus)
Sets the context local modulus for modular arithmetic (used by Operable operations only). |
Integer64 |
subtract(Integer64 that)
Returns the difference between this number and the one specified. |
Operable |
times(Operable that)
Returns the product of this object with the one specified. |
java.lang.String |
toString()
Returns the decimal text representation of this number. |
void |
toXml(XmlElement xml)
Sets the attributes and content of the XML element corresponding to this object. |
static Integer64 |
valueOf(java.lang.CharSequence chars)
Returns the 64 bits integer for the specified character sequence. |
static Integer64 |
valueOf(long longValue)
Returns the 64 bits integer of specified long value. |
static Integer64 |
valueOf(XmlElement xml)
XML factory method. |
Methods inherited from class com.dautelle.math.numbers.RealtimeNumber |
clone, export, isLocalObject, isPoolObject, pow, recycle, toHeap |
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 Integer64 ZERO
public static final Integer64 ONE
Method Detail |
public static Integer64 valueOf(long longValue)
long
value.
longValue
- the long
value for this number.
intValue()
public static Integer64 valueOf(java.lang.CharSequence chars)
chars
- the character sequence.
public static Integer64 valueOf(XmlElement xml)
xml
- the XML element describing the number to return
(e.g.<math:Integer64 value="0"/>
).
public Integer64 negate()
-this
.public Integer64 add(Integer64 that)
that
- the number to be added.
this + that
.public Integer64 subtract(Integer64 that)
that
- the number to be subtracted.
this - that
.public Integer64 multiply(Integer64 that)
that
- the multiplier.
this * that
.public Integer64 divide(Integer64 that)
that
- the divisor.
this / that
.public Integer64 mod(Integer64 m)
m
- the modulus.
this mod m
java.lang.ArithmeticException
- if !m.isPositive()
public Integer64 abs()
abs(this)
.public java.lang.StringBuffer appendTo(java.lang.StringBuffer sb)
StringBuffer
argument.
sb
- the StrinBuffer
to append.
StrinBuffer
.public java.lang.String toString()
public boolean equals(java.lang.Object that)
that
- the object to compare with.
true
if the objects are the same;
false
otherwise.public int hashCode()
public int intValue()
int
.
int
value.public long longValue()
long
.
long
value.public float floatValue()
float
.
float
value.public double doubleValue()
double
.
double
value.public int compareTo(Integer64 that)
that
- the number to compare with.
that
.public int compareTo(java.lang.Object that)
compareTo
in interface java.lang.Comparable
public void toXml(XmlElement xml)
Representable
toXml
in interface Representable
xml
- the XML element to set according to this object's desired XML
representation.public static void setModulus(Integer64 modulus)
Operable
operations only). If the modulus is not set
the reciprocal()
operation raises
IllegalStateException
.
modulus
- the new modulus or null
to unset the modulus.
java.lang.IllegalArgumentException
- if modulus <= 0
LocalContext
,
plus
,
opposite
,
times
,
reciprocal
public Operable plus(Operable that)
Operable
plus
in interface Operable
that
- the object to be added.
this + that
.public Operable opposite()
Operable
this.plus(this.opposite()) == ZERO
,
with ZERO
being the additive identity.
opposite
in interface Operable
-this
.public Operable times(Operable that)
Operable
times
in interface Operable
that
- the object multiplier.
this * that
.public Operable reciprocal()
Operable
this.times(this.reciprocal()) == ONE
,
with ONE
being the multiplicative identity.
reciprocal
in interface Operable
ONE / this
.
|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |