Class SimpleQueue<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>, java.util.Queue<T>

    public class SimpleQueue<T>
    extends java.util.AbstractQueue<T>
    Simple queue. All methods are thread-safe.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.LinkedList<T> list  
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleQueue()  
      SimpleQueue​(int initializeCapacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Iterator<T> iterator()  
      boolean offer​(T e)  
      T peek()  
      T poll()  
      int size()  
      • Methods inherited from class java.util.AbstractQueue

        add, addAll, clear, element, remove
      • Methods inherited from class java.util.AbstractCollection

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

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

        contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Field Detail

      • list

        protected final java.util.LinkedList<T> list
    • Constructor Detail

      • SimpleQueue

        public SimpleQueue​(int initializeCapacity)
      • SimpleQueue

        public SimpleQueue()
    • Method Detail

      • offer

        public boolean offer​(T e)
      • peek

        public T peek()
      • poll

        public T poll()
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.util.Collection<T>
        Specified by:
        iterator in interface java.lang.Iterable<T>
        Specified by:
        iterator in class java.util.AbstractCollection<T>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<T>
        Specified by:
        size in class java.util.AbstractCollection<T>