hades.simulator
Class SimEventRecycler
java.lang.Object
hades.simulator.SimEventRecycler
- public class SimEventRecycler
- extends java.lang.Object
SimEventRecycler manages a stack to keep and re-initialize used objects,
instead of handing them over to the garbage-collector.
Normally, you would just forget used objects in Java. However, when
allocating large numbers of objects, it may be helpful to keep track
of them, especially given the shortcomings of the garbage collectors
implemented so far.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
enable_recycling
boolean enable_recycling
n_created
public long n_created
n_recycled
public long n_recycled
n_available
public long n_available
SimEventRecycler
public SimEventRecycler()
recycleNode
public void recycleNode(SimEvent victim)
- recycle a SimEvent for later reuse.
However, we won't keep more than STACK_SIZE objects.
hasRecycledNodes
public boolean hasRecycledNodes()
getRecycledSimEvent
public SimEvent getRecycledSimEvent()
printStatus
public java.lang.String printStatus()
toString
public java.lang.String toString()