|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bulletphysics.util.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()
|
Method Summary | |
---|---|
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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StackList()
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |