hades.simulator
Class SimEventRecycler

java.lang.Object
  extended byhades.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.


Field Summary
(package private)  boolean enable_recycling
           
 long n_available
           
 long n_created
           
 long n_recycled
           
 
Constructor Summary
SimEventRecycler()
           
 
Method Summary
 SimEvent getRecycledSimEvent()
           
 boolean hasRecycledNodes()
           
 java.lang.String printStatus()
           
 void recycleNode(SimEvent victim)
          recycle a SimEvent for later reuse.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enable_recycling

boolean enable_recycling

n_created

public long n_created

n_recycled

public long n_recycled

n_available

public long n_available
Constructor Detail

SimEventRecycler

public SimEventRecycler()
Method Detail

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()