Class CmsThreadLocalStack<T>

  • Type Parameters:
    T - the type for the stack elements

    public class CmsThreadLocalStack<T>
    extends java.lang.Object
    Thread local stack.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T pop()
      Removes and returns the last element pushed onto the stack.
      void push​(T data)
      Pushes a new element onto the stack.
      int size()
      Returns the current stack size.
      T top()
      Returns the current top of the stack, without removing it.
      • Methods inherited from class java.lang.Object

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

      • pop

        public T pop()
        Removes and returns the last element pushed onto the stack.
        Returns:
        the last element pushed onto the stack
      • push

        public void push​(T data)
        Pushes a new element onto the stack.
        Parameters:
        data - the element to push on the stack
      • size

        public int size()
        Returns the current stack size.
        Returns:
        the current stack size
      • top

        public T top()
        Returns the current top of the stack, without removing it.

        If the stack is empty, null is returned.

        Returns:
        the current top of the stack