org.apache.tomcat.util.collections

Class SimplePool


public final class SimplePool
extends java.lang.Object

Simple object pool. Based on ThreadPool and few other classes The pool will ignore overflow and return null if empty.

Authors:
Gal Shachor
Costin Manolache

Field Summary

static int
DEFAULT_SIZE

Constructor Summary

SimplePool()
SimplePool(int size)
SimplePool(int size, int max)

Method Summary

Object
get()
Get an object from the pool, null if the pool is empty.
int
getCount()
Number of object in the pool
int
getMax()
Return the size of the pool
void
put(Object o)
Add the object to the pool, silent nothing if the pool is full
void
set(Object o)
void
shutdown()

Field Details

DEFAULT_SIZE

public static final int DEFAULT_SIZE

Field Value:
32

Constructor Details

SimplePool

public SimplePool()


SimplePool

public SimplePool(int size)


SimplePool

public SimplePool(int size,
                  int max)

Method Details

get

public Object get()
Get an object from the pool, null if the pool is empty.


getCount

public int getCount()
Number of object in the pool


getMax

public int getMax()
Return the size of the pool


put

public void put(Object o)
Add the object to the pool, silent nothing if the pool is full


set

public void set(Object o)


shutdown

public void shutdown()


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.