Class ThreadLocalStack
- java.lang.Object
-
- org.onemind.commons.java.datastructure.ThreadLocalStack
-
public class ThreadLocalStack extends java.lang.Object
A stack associated with current thread- Version:
- $Id: ThreadLocalStack.java,v 1.2 2004/08/26 12:33:16 thlee Exp $ $Name: $
- Author:
- TiongHiang Lee (thlee@onemindsoft.org)
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ThreadLocal
_local
the thread local *
-
Constructor Summary
Constructors Constructor Description ThreadLocalStack()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getLocal()
Get the top-most local object in local stackStack
getLocalStack()
get the local stackjava.lang.Object
popLocal()
Pop the top-most local object in threadlocal stackvoid
popLocalUtil(int i)
Pop uptil certain size in local stackint
pushLocal(java.lang.Object localObject)
Push a local object the the thread local stack
-
-
-
Method Detail
-
pushLocal
public int pushLocal(java.lang.Object localObject)
Push a local object the the thread local stack- Parameters:
localObject
- the local object- Returns:
- the size after the push
-
getLocalStack
public Stack getLocalStack()
get the local stack- Returns:
- the stack
-
getLocal
public java.lang.Object getLocal()
Get the top-most local object in local stack- Returns:
- the top-most local object in local stack
-
popLocalUtil
public void popLocalUtil(int i)
Pop uptil certain size in local stack- Parameters:
i
- the size
-
popLocal
public java.lang.Object popLocal()
Pop the top-most local object in threadlocal stack- Returns:
- the top-most local object
-
-