|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.wimpi.text.ResourcePool
Class that implements a pool for ProcessingResource
instances.
The factory method is used for creating pools of the
given resource and size, using the resource's factory method
to create the requested amount of instances.
ProcessingResource.createResource()
Method Summary | |
void |
clear()
Removes all ProcessingResource references from
this pool. |
static ResourcePool |
createResourcePool(int size,
ProcessingResource resource)
Creates a ResourcePool with the given size, containing the given ProcessingResource instances. |
int |
getCeiling()
Returns the ceiling (in terms of size) of this pool. |
protected void |
initPool()
Initializes a pool of ProcessingResource instances. |
ProcessingResource |
leaseResource()
Returns a leased ProcessingResource instance from this
pool. |
void |
releaseResource(ProcessingResource resource)
Releases a formerly leased ProcessingResource , returning
it into this pool. |
void |
resize(int size)
Resizes the pool. |
int |
size()
Returns the size of this pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public ProcessingResource leaseResource()
ProcessingResource
instance from this
pool.ProcessingResource
from this pool.public void releaseResource(ProcessingResource resource)
ProcessingResource
, returning
it into this pool.resource
- the formerly leased ProcessingResource
to be released.public int getCeiling()
int
.public int size()
int
.public void resize(int size)
size
- the new size as int
.public void clear()
ProcessingResource
references from
this pool.
Note that it will do so gracefully, waiting for
leased ProcessingResources
.protected void initPool()
ProcessingResource
instances.public static ResourcePool createResourcePool(int size, ProcessingResource resource)
ProcessingResource
instances.size
- the size as int
.resource
- the ProcessingResource
to be pooled.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |