T - public class Pool<T> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Pool.Creator<T>
The Creator Interface give the Pool the ability to Create, Destroy and
Validate the Objects it is maintaining.
|
static class |
Pool.Pooled<T>
The "Pooled
|
| Constructor and Description |
|---|
Pool(Pool.Creator<T> creator)
Create a new Pool, given the implementation of Creator
|
| Modifier and Type | Method and Description |
|---|---|
void |
drain()
Destroy and remove all remaining objects.
|
Pool.Pooled<T> |
get()
This is the essential function for Pool.
|
Pool.Pooled<T> |
get(LogTarget lt)
This is the essential function for Pool.
|
int |
getMaxRange()
Get the maximum number of spare objects allowed at any moment
|
void |
prime(LogTarget lt,
int prime)
Preallocate a certain number of T Objects.
|
void |
setMaxRange(int max_range)
Set a Max Range for numbers of spare objects waiting to be used.
|
boolean |
validate()
This function will validate whether the Objects are still in a usable
state.
|
public Pool(Pool.Creator<T> creator)
creator - public void prime(LogTarget lt, int prime) throws APIException
lt - prime - APIExceptionpublic void drain()
public Pool.Pooled<T> get() throws APIException
lt - APIExceptionpublic Pool.Pooled<T> get(LogTarget lt) throws APIException
lt - APIExceptionpublic boolean validate()
public int getMaxRange()
public void setMaxRange(int max_range)
Copyright © 2017. All rights reserved.