net.sf.cindy.buffer
Class DefaultBufferPool

java.lang.Object
  extended by net.sf.cindy.buffer.DefaultBufferPool
All Implemented Interfaces:
BufferPool

public class DefaultBufferPool
extends java.lang.Object
implements BufferPool

Default implementation of BufferPool.

Version:
$id$
Author:
Roger Chen

Constructor Summary
DefaultBufferPool()
           
 
Method Summary
 Buffer allocate(int capacity, boolean direct)
          Allocate buffer from pool.
 void clear()
           
 double getHitRate()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultBufferPool

public DefaultBufferPool()
Method Detail

allocate

public Buffer allocate(int capacity,
                       boolean direct)
Description copied from interface: BufferPool
Allocate buffer from pool.

Specified by:
allocate in interface BufferPool
Parameters:
capacity - capacity
direct - allocate direct buffer
Returns:
allocated buffer

clear

public void clear()

getHitRate

public double getHitRate()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object