|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjist.runtime.Pool
jist.runtime.Pool.ArrayPool
public static class Pool.ArrayPool
Implements an object pool for the massively used Object array objects. Note that, for performance reasons, this class is intentionally NOT thread-safe.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jist.runtime.Pool |
|---|
Pool.ArrayPool, Pool.ContinuationPool, Pool.EventPool |
| Field Summary | |
|---|---|
private int |
count
Index into array pool. |
private java.lang.Object[][] |
pool
Private array pool of Object arrays of size 'size'. |
private int |
size
Size of Object arrays pooled. |
| Constructor Summary | |
|---|---|
Pool.ArrayPool(int arraysize,
int poolsize)
Create new object array pool of given size, for array of given size. |
|
| Method Summary | |
|---|---|
java.lang.Object[] |
get()
Return an array from the pool, or create a new one if pool is empty. |
static void |
main(java.lang.String[] args)
Small program to test performance of ArrayPool implementation. |
void |
put(java.lang.Object[] o)
Place a free (otherwise unused) array object back in the pool, if there is space. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final int size
private final java.lang.Object[][] pool
private int count
| Constructor Detail |
|---|
public Pool.ArrayPool(int arraysize,
int poolsize)
arraysize - object array size pooledpoolsize - size of object array pool| Method Detail |
|---|
public java.lang.Object[] get()
public void put(java.lang.Object[] o)
o - reference to free array objectpublic static void main(java.lang.String[] args)
args - command line parameters
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||