TYPE
- type of objects to be pooled.public abstract class OAPool<TYPE> extends Object
Constructor and Description |
---|
OAPool(Class clazz,
int min,
int max) |
OAPool(int min,
int max) |
Modifier and Type | Method and Description |
---|---|
void |
add(TYPE obj) |
protected abstract TYPE |
create()
Callback method used to request a new object for the pool.
|
TYPE |
get() |
Object[] |
getAllItems() |
int |
getCurrentSize() |
int |
getCurrentUsed() |
int |
getMaximum() |
int |
getMinimum() |
void |
loadMinimum()
This will make sure that the pool has at least minimum amount of objects.
|
void |
release(TYPE resource) |
void |
remove(TYPE resource) |
protected abstract void |
removed(TYPE resource)
Callback method used when an object in the pool is no longer needed.
|
void |
setHighMarkTimeLimit(int ms)
Amount of time to wait before removing extra objects from the pool.
|
void |
setMaximum(int x) |
void |
setMinimum(int x) |
public OAPool(Class clazz, int min, int max)
public OAPool(int min, int max)
public void setHighMarkTimeLimit(int ms)
public void setMinimum(int x)
public int getMinimum()
public void setMaximum(int x)
public int getMaximum()
public int getCurrentSize()
public int getCurrentUsed()
public void loadMinimum()
public TYPE get()
public void remove(TYPE resource)
public void release(TYPE resource)
public Object[] getAllItems()
public void add(TYPE obj)
protected abstract TYPE create()
protected abstract void removed(TYPE resource)
Copyright © 1999–2019 ViaOA. All rights reserved.