|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bulletphysics.StackList<T>
public abstract class StackList<T>
Stack-based object pool, see the example for usage. You must use the returning(T)
method for returning stack-allocated instance.
Example code:
StackList<Vector3f> vectors; ... vectors.push(); try { Vector3f vec = vectors.get(); ... return vectors.returning(vec); } finally { vectors.pop(); }
Constructor Summary | |
---|---|
|
StackList()
|
protected |
StackList(boolean unused)
|
Method Summary | |
---|---|
protected abstract void |
copy(T dest,
T src)
Copies data from one instance to another. |
protected abstract T |
create()
Creates a new instance of type. |
T |
get()
Returns instance from stack pool, or create one if not present. |
void |
pop()
Pops the stack. |
void |
push()
Pushes the stack. |
T |
returning(T obj)
Copies given instance into one slot static instance and returns it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StackList()
protected StackList(boolean unused)
Method Detail |
---|
public final void push()
public final void pop()
public T get()
pop()
is called.
public final T returning(T obj)
obj
- stack-allocated instance
protected abstract T create()
protected abstract void copy(T dest, T src)
dest
- src
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |