Module openj9.dtfj

Class IntegerStack

java.lang.Object
com.ibm.j9ddr.corereaders.tdump.zebedee.util.IntegerStack

public final class IntegerStack extends Object
This class implements a simple stack of integers.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IntegerStack(int size)
    Create a new stack with the given size.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Return the depth of the stack.
    int
    Return the integer at the top of the stack without popping it.
    int
    pop()
    Pop an integer off the stack.
    void
    push(int n)
    Push an integer on the stack.

    Methods declared in class java.lang.Object

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

    • IntegerStack

      public IntegerStack(int size)
      Create a new stack with the given size. It will grow as necessary.
  • Method Details

    • push

      public void push(int n)
      Push an integer on the stack.
    • pop

      public int pop()
      Pop an integer off the stack.
    • peek

      public int peek()
      Return the integer at the top of the stack without popping it.
    • depth

      public int depth()
      Return the depth of the stack.