ecologylab.generic
Class CharBufferPool

java.lang.Object
  extended by ecologylab.generic.Debug
      extended by ecologylab.generic.ResourcePool<T>
          extended by ecologylab.generic.ResourcePoolWithSize<java.nio.CharBuffer>
              extended by ecologylab.generic.CharBufferPool

public class CharBufferPool
extends ResourcePoolWithSize<java.nio.CharBuffer>

ResourcePool for StringBuilders.

Author:
Zachary O. Toups (toupsz@cs.tamu.edu)

Field Summary
 
Fields inherited from class ecologylab.generic.ResourcePoolWithSize
resourceObjectCapacity
 
Fields inherited from class ecologylab.generic.ResourcePool
DEFAULT_POOL_SIZE
 
Constructor Summary
CharBufferPool(int builderSize)
           
CharBufferPool(int poolSize, int minimumCapacity, int builderSize)
           
 
Method Summary
protected  void clean(java.nio.CharBuffer objectToClean)
          Ensure that the given Object is "clean", that is, in the state it would be in if it were just instantiated.
protected  java.nio.CharBuffer generateNewResource()
          Instantiates a resource of type T.
 
Methods inherited from class ecologylab.generic.ResourcePool
acquire, instantiateResourcesInPool, release
 
Methods inherited from class ecologylab.generic.Debug
classSimpleName, closeLoggingFile, debug, debug, debug, debug, debugA, debugA, debugA, debugI, debugI, debugI, error, error, getClassName, getClassName, getInteractive, getPackageName, getPackageName, getPackageName, initialize, level, level, level, logToFile, print, print, println, println, println, println, println, println, printlnA, printlnA, printlnA, printlnI, printlnI, printlnI, printlnI, setLoggingFile, show, show, superString, toggleInteractive, toString, toString, warning, warning, weird, weird
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharBufferPool

public CharBufferPool(int builderSize)
Parameters:
builderSize - the size of StringBuilders created within this pool.

CharBufferPool

public CharBufferPool(int poolSize,
                      int minimumCapacity,
                      int builderSize)
Parameters:
poolSize -
Method Detail

clean

protected void clean(java.nio.CharBuffer objectToClean)
Description copied from class: ResourcePool
Ensure that the given Object is "clean", that is, in the state it would be in if it were just instantiated. For example, if this class were handling StringBuilders, it should ensure that the StringBuilder does not contain any characters from a previous use. clean(T) is automatically called immediately before an object is returned from the acquire() method.

Specified by:
clean in class ResourcePool<java.nio.CharBuffer>
See Also:
ResourcePool.clean(java.lang.Object)

generateNewResource

protected java.nio.CharBuffer generateNewResource()
Description copied from class: ResourcePool
Instantiates a resource of type T.

Specified by:
generateNewResource in class ResourcePool<java.nio.CharBuffer>
Returns:
See Also:
ResourcePool.generateNewResource()