public class

StringBuilderPool

extends SimplePool<T>
java.lang.Object
   ↳ com.mongodb.util.SimplePool<T>
     ↳ com.mongodb.util.StringBuilderPool

Summary

[Expand]
Inherited Fields
From class com.mongodb.util.SimplePool
Public Constructors
StringBuilderPool(String name, int maxToKeep, int maxSize)
Initializes a pool of a given number of StringBuilders, each of a certain size.
Public Methods
StringBuilder createNew()
Create a new string builder.
boolean ok(StringBuilder buf)
Checks that the given string builder is within the size limit.
Protected Methods
long memSize(StringBuilder buf)
[Expand]
Inherited Methods
From class com.mongodb.util.SimplePool
From class java.lang.Object
From interface javax.management.DynamicMBean

Public Constructors

public StringBuilderPool (String name, int maxToKeep, int maxSize)

Initializes a pool of a given number of StringBuilders, each of a certain size.

Parameters
maxToKeep the number of string builders in the pool
maxSize the size of each string builder

Public Methods

public StringBuilder createNew ()

Create a new string builder.

Returns
  • the string builder

public boolean ok (StringBuilder buf)

Checks that the given string builder is within the size limit.

Parameters
buf the builder to check
Returns
  • if it is not too big

Protected Methods

protected long memSize (StringBuilder buf)