ObjectPool

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openmali.pooling
Class ObjectPool<T>

    java.lang.Object
      org.openmali.pooling.ObjectPool<T>

Type Parameters:
  `T` -

    public abstract class ObjectPool<T>

extends java.lang.Object

Simple collection used to store free objects which we need to work with frequently. This is to solve some of the issues with garbage collection of frequently used objects

Author:
  David Yazel, Marvin Froehlich (aka Qudus)

Constructor Summary
`ObjectPool(int initialSize)`

Method Summary
`T` | `alloc()`
`void` | `free(T o)`
`int` | `getSize()`
`protected abstract T` | `newInstance()` Creates a new instance of a pooled object.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ObjectPool

    public ObjectPool(int initialSize)

Method Detail

### getSize

    public int getSize()

### newInstance

    protected abstract T newInstance()

  Creates a new instance of a pooled object.

  Returns:
    the new object instance

### alloc

    public T alloc()

### free

    public void free(T o)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD