public class Pool<T>
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
Pool.Creator<T> |
class |
Pool.Element<T> |
限定符和类型 | 字段和说明 |
---|---|
protected Pool.Creator<T> |
creator |
protected java.util.concurrent.locks.Lock[] |
locks |
protected T[] |
pool |
构造器和说明 |
---|
Pool(int capacity,
Pool.Creator<T> creator) |
限定符和类型 | 方法和说明 |
---|---|
Pool.Element<T> |
get()
Gets the next available resource for which the lock can be acquired and returns it and its associated
lock, which needs to be released when the caller is done using the resource.
|
T[] |
getElements() |
int |
getNumLocked() |
static void |
main(java.lang.String[] args) |
java.lang.String |
toString() |
protected final T[] pool
protected final java.util.concurrent.locks.Lock[] locks
protected final Pool.Creator<T> creator
public Pool(int capacity, Pool.Creator<T> creator)
public T[] getElements()
public int getNumLocked()
public Pool.Element<T> get()
public java.lang.String toString()
toString
在类中 java.lang.Object
public static void main(java.lang.String[] args)