libgdx API

com.badlogic.gdx.utils
Class Pools

java.lang.Object
  extended by com.badlogic.gdx.utils.Pools

public class Pools
extends java.lang.Object

Stores a map of ReflectionPools by type for convenient static access.

Author:
Nathan Sweet

Method Summary
static void free(java.lang.Object object)
          Frees an object from the pool.
static void freeAll(Array objects)
          Frees the specified objects from the pool.
static
<T> Pool<T>
get(java.lang.Class<T> type)
          Returns a new or existing pool for the specified type, stored in a a Class to ReflectionPool map.
static
<T> T
obtain(java.lang.Class<T> type)
          Obtains an object from the pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static <T> Pool<T> get(java.lang.Class<T> type)
Returns a new or existing pool for the specified type, stored in a a Class to ReflectionPool map. The max size of the pool used is 100.


obtain

public static <T> T obtain(java.lang.Class<T> type)
Obtains an object from the pool.


free

public static void free(java.lang.Object object)
Frees an object from the pool.


freeAll

public static void freeAll(Array objects)
Frees the specified objects from the pool.


libgdx API

Copyright 2010 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)