Package ghidra.util.datastruct

# 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.

- ## Field Summary

  ### Fields inherited from class ghidra.util.datastruct.Stack

  `list`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FixedSizeStack(int maxSize)`
  Creates a fixed size stack with the specified max size.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `add(E item)`
  Appends the given item to the top of the stack.
  `E`
  `push(E item)`
  Pushes an item onto the top of this stack.
  `E`
  `remove(int index)`

  ### Methods inherited from class ghidra.util.datastruct.Stack

  `clear, equals, get, hashCode, isEmpty, iterator, peek, pop, search, size, stream, toString`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## 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)