java.lang.Object
org.rrd4j.data.RpnCalculator.RpnStack
Enclosing class:
RpnCalculator

private static final class RpnCalculator.RpnStackextends Object
RpnStack class.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final int
    Maximum RPN stack depth
    private int
    Current stack position
    private final double[]
    RPN stack storage
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    The stack an RPN expression is evaluated on.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    (package private) boolean
    Whether the stack holds no values.
    (package private) double
    Examine the top value on the stack without removing it
    (package private) double
    pop()
    Pop a value from the RPN stack
    (package private) void
    push(double x)
    Push a value onto the RPN stack
    (package private) void
    Reset the allocator state

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_STACK_SIZE

      private static final int MAX_STACK_SIZE
      Maximum RPN stack depth
      See Also:
    • stack

      private final double[] stack
      RPN stack storage
    • pos

      private int pos
      Current stack position
  • Constructor Details

    • RpnStack

      private RpnStack()
      The stack an RPN expression is evaluated on.
  • Method Details

    • push

      void push(double x)
      Push a value onto the RPN stack
      Parameters:
      x - the value to push
    • pop

      double pop()
      Pop a value from the RPN stack
      Returns:
      the top value, removed from the stack
    • peek

      double peek()
      Examine the top value on the stack without removing it
      Returns:
      the top value, left on the stack
    • reset

      void reset()
      Reset the allocator state
    • isEmpty

      boolean isEmpty()
      Whether the stack holds no values.
      Returns:
      true if the stack is empty