Interface PrimitiveStack

  • All Known Implementing Classes:
    FloatStack, IntegerStack

    public interface PrimitiveStack
    Simple primitive-type stack.
    • Method Detail

      • capacity

        int capacity()
        Returns this stack's current capacity.

        The capacity may grow with a put operation w/ insufficient remaining() elements left, if getGrowSize() > 0.

      • position

        int position()
        Returns the current position of this stack.

        Position is in the range: 0 ≤ position < capacity().

        The position equals to the number of elements stored.

      • remaining

        int remaining()
        Returns the remaining elements left before stack will grow about getGrowSize().
           remaining := capacity() - position();

        0 denotes a full stack.

        See Also:
        capacity(), position()
      • getGrowSize

        int getGrowSize()
        Returns the grow size. A stack grows by this size in case a put operation exceeds it's capacity().
      • setGrowSize

        void setGrowSize​(int newGrowSize)
        Set new {@link #growSize().