|
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
This class provides a default implementation of the Realtime
interface for objects of type java.lang.Number
.
Instances of this class should be created using a RealtimeNumber.Factory
.
Instances of this class are immutable. But like any real-time object,
instances allocated in a pool context must be exported
if referenced after exiting the pool context.
Nested Class Summary | |
protected static class |
RealtimeNumber.Factory
This abstract class represents the factory responsible for the creation of RealtimeNumber instances. |
Constructor Summary | |
protected |
RealtimeNumber()
Default constructor. |
Method Summary | |
protected java.lang.Object |
clone()
Overrides the clone method to ensure that the copy references the heap pool. |
java.lang.Object |
export()
Exports this object out of the current pool context. |
boolean |
isLocalObject()
Indicates if this object is an object local to the current pool context. |
boolean |
isPoolObject()
Indicates if this object belongs to a pool (stack allocated object). |
Operable |
pow(int exp)
Returns this Operable number raised at the specified exponent. |
protected void |
recycle()
Recycles this object. |
java.lang.Object |
toHeap()
Moves this object to the heap. |
Methods inherited from class java.lang.Number |
byteValue, doubleValue, floatValue, intValue, longValue, shortValue |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.dautelle.math.Operable |
opposite, plus, reciprocal, times |
Methods inherited from interface com.dautelle.xml.Representable |
toXml |
Constructor Detail |
protected RealtimeNumber()
Method Detail |
public Operable pow(int exp)
Operable
number raised at the specified exponent.
exp
- the exponent.
thisexp
public final boolean isLocalObject()
Note: Due to the "export" rule, non-local objects cannot refer to local object.
true
if this object belongs to the current
pool context; false
otherwise.public final boolean isPoolObject()
Note: Due to the "export" rule, heap objects cannot refer to pool object.
true
if this object belongs to a pool;
false
if this object belongs to the heap.protected void recycle()
local objects
and has no effect on heap objects or objects allocated outside of
the current pool context. Recycling is limited to this object and
its internal and has no effect on any shared member.
public java.lang.Object export()
Realtime
Realtime
members are exported as well (recursion).
This method affects only objects belonging to the current pool context.
To avoid pool depletion, a "free" object from the outer pool
is moved to replace the object being exported.
export
in interface Realtime
this
public java.lang.Object toHeap()
Realtime
Realtime
members are moved to the heap as well (recursion).
This method affects only objects belonging to a pool context
(current or not).
toHeap
in interface Realtime
this
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
|
JADE v6.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |