Class CmsThreadLocalStack<T>

java.lang.Object
org.opencms.util.CmsThreadLocalStack<T>
Type Parameters:
T - the type for the stack elements

public class CmsThreadLocalStack<T> extends Object
Thread local stack.
  • Constructor Details

  • Method Details

    • 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