public class StringBuilderPool extends SimplePool<StringBuilder>
_availSafe, _debug, _maxToKeep, _maxTotal, _mbeanInfo, _name, _trackLeaks
Constructor and Description |
---|
StringBuilderPool(String name,
int maxToKeep,
int maxSize)
Initializes a pool of a given number of StringBuilders, each of a certain size.
|
Modifier and Type | Method and Description |
---|---|
StringBuilder |
createNew()
Create a new string builder.
|
protected long |
memSize(StringBuilder buf) |
boolean |
ok(StringBuilder buf)
Checks that the given string builder is within the size limit.
|
available, cleanup, clear, done, everCreated, get, get, getAll, getAttribute, getAttributes, getMBeanInfo, inUse, invoke, maxToKeep, pick, remove, setAttribute, setAttributes, toString, total
public StringBuilderPool(String name, int maxToKeep, int maxSize)
maxToKeep
- the number of string builders in the poolmaxSize
- the size of each string builderpublic StringBuilder createNew()
createNew
in class SimplePool<StringBuilder>
public boolean ok(StringBuilder buf)
ok
in class SimplePool<StringBuilder>
buf
- the builder to checkprotected long memSize(StringBuilder buf)