libgdx API

com.badlogic.gdx.utils
Class ReflectionPool<T>

java.lang.Object
  extended by com.badlogic.gdx.utils.Pool<T>
      extended by com.badlogic.gdx.utils.ReflectionPool<T>

public class ReflectionPool<T>
extends Pool<T>

Pool that creates new instances of a type using reflection. The type must have a zero argument constructor. AccessibleObject.setAccessible(boolean) will be used if the class and/or constructor is not visible.

Author:
Nathan Sweet

Nested Class Summary
 
Nested classes/interfaces inherited from class com.badlogic.gdx.utils.Pool
Pool.Poolable
 
Field Summary
 
Fields inherited from class com.badlogic.gdx.utils.Pool
max
 
Constructor Summary
ReflectionPool(java.lang.Class<T> type)
           
ReflectionPool(java.lang.Class<T> type, int initialCapacity)
           
ReflectionPool(java.lang.Class<T> type, int initialCapacity, int max)
           
 
Method Summary
protected  T newObject()
           
 
Methods inherited from class com.badlogic.gdx.utils.Pool
clear, free, freeAll, obtain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionPool

public ReflectionPool(java.lang.Class<T> type)

ReflectionPool

public ReflectionPool(java.lang.Class<T> type,
                      int initialCapacity,
                      int max)

ReflectionPool

public ReflectionPool(java.lang.Class<T> type,
                      int initialCapacity)
Method Detail

newObject

protected T newObject()
Specified by:
newObject in class Pool<T>

libgdx API

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