Class ThreadLocalStack<E>


  • public class ThreadLocalStack<E>
    extends java.lang.Object
    A thread local stack data structure. In order to avoid memory churn the underlying ArrayDeque is never freed. If we remove the deque when it is empty then this results in excessive deque allocations.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isEmpty()  
      E peek()  
      E pop()  
      void push​(E item)  
      • Methods inherited from class java.lang.Object

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

      • ThreadLocalStack

        public ThreadLocalStack()
    • Method Detail

      • push

        public void push​(E item)
      • peek

        public E peek()
      • pop

        public E pop()
      • isEmpty

        public boolean isEmpty()