Class 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 *
    • 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 stack
      Stack getLocalStack()
      get the local stack
      java.lang.Object popLocal()
      Pop the top-most local object in threadlocal stack
      void popLocalUtil​(int i)
      Pop uptil certain size in local stack
      int pushLocal​(java.lang.Object localObject)
      Push a local object the the thread local stack
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _local

        private java.lang.ThreadLocal _local
        the thread local *
    • Constructor Detail

      • ThreadLocalStack

        public ThreadLocalStack()
    • 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