Class FixedSizeStack<E>

java.lang.Object
ghidra.util.datastruct.Stack<E>
ghidra.util.datastruct.FixedSizeStack<E>
All Implemented Interfaces:
Iterable<E>

public class FixedSizeStack<E> extends Stack<E>
Creates a fixed size stack. The oldest (or deepest) item on the stack will be removed when the max size is achieved.
  • Constructor Details

    • FixedSizeStack

      public FixedSizeStack(int maxSize)
      Creates a fixed size stack with the specified max size.
      Parameters:
      maxSize - the max size of the stack
  • Method Details

    • push

      public E push(E item)
      Description copied from class: Stack
      Pushes an item onto the top of this stack.
      Overrides:
      push in class Stack<E>
      Parameters:
      item - the object to push onto the stack.
    • add

      public void add(E item)
      Description copied from class: Stack
      Appends the given item to the top of the stack.
      Overrides:
      add in class Stack<E>
      Parameters:
      item - the new top of the stack
    • remove

      public E remove(int index)