Class Stack

  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Collection

    public final class Stack
    extends java.util.AbstractCollection
    • Constructor Summary

      Constructors 
      Constructor Description
      Stack()  
      Stack​(int size)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.Object o)  
      void clear()  
      java.lang.Object clone()  
      boolean isEmpty()  
      java.util.Iterator iterator()  
      java.lang.Object peek()  
      java.lang.Object pop()  
      void push​(java.lang.Object o)  
      int size()  
      • Methods inherited from class java.util.AbstractCollection

        addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • Stack

        public Stack()
      • Stack

        public Stack​(int size)
    • Method Detail

      • add

        public boolean add​(java.lang.Object o)
        Specified by:
        add in interface java.util.Collection
        Overrides:
        add in class java.util.AbstractCollection
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection
        Overrides:
        clear in class java.util.AbstractCollection
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection
        Overrides:
        isEmpty in class java.util.AbstractCollection
      • iterator

        public java.util.Iterator iterator()
        Specified by:
        iterator in interface java.util.Collection
        Specified by:
        iterator in interface java.lang.Iterable
        Specified by:
        iterator in class java.util.AbstractCollection
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in class java.util.AbstractCollection
      • push

        public void push​(java.lang.Object o)
      • pop

        public java.lang.Object pop()
      • peek

        public java.lang.Object peek()