inua.util
Class Pool

java.lang.Object
  extended by inua.util.Pool

public class Pool
extends Object

Object pool, call recycle to start reusing them.


Field Summary
private  Constructor constructor
           
private  Object[] constructorArgs
           
private  int nextEvent
           
private  List pool
           
 
Constructor Summary
Pool(Class sample)
          A simple pool.
Pool(Class sample, Object param)
          A pool where each object's constructor is parameterized with PARAM (It does an exact match of PARAM's class, is that a good idea?).
 
Method Summary
 Object get()
          Return an object from the pool.
 void recycle()
          Recycle all objects from the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

constructor

private Constructor constructor

constructorArgs

private Object[] constructorArgs

pool

private List pool

nextEvent

private int nextEvent
Constructor Detail

Pool

public Pool(Class sample)
A simple pool.


Pool

public Pool(Class sample,
            Object param)
A pool where each object's constructor is parameterized with PARAM (It does an exact match of PARAM's class, is that a good idea?).

Method Detail

get

public Object get()
Return an object from the pool.


recycle

public void recycle()
Recycle all objects from the pool.