对象池
This commit is contained in:
parent
c0b896c4fe
commit
b8e4f9509b
|
@ -72,6 +72,7 @@ public class ObjectPool<T> implements Iterable<T> {
|
|||
|
||||
/**
|
||||
* 覆写迭代器,便于遍历对象池
|
||||
* @return 迭代器
|
||||
*/
|
||||
@NotNull
|
||||
@Override
|
||||
|
@ -79,8 +80,14 @@ public class ObjectPool<T> implements Iterable<T> {
|
|||
return this.pool.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* 覆写toString方法,便于输出对象池信息
|
||||
* @return 对象池信息
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return this.pool.toString();
|
||||
return "ObjectPool{" +
|
||||
"pool=" + pool +
|
||||
"} Count: " + pool.size();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue