Class TreeSetQueue<T extends Queue.QueueEntry>

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable, Queue<T>

    public class TreeSetQueue<T extends Queue.QueueEntry>
    extends java.lang.Object
    implements Queue<T>, java.io.Externalizable
    See Also:
    Serialized Form
    • Nested Class Summary

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static org.slf4j.Logger log  
    • Constructor Summary

      Constructors 
      Constructor Description
      TreeSetQueue()  
      TreeSetQueue​(java.util.Comparator<T> comparator)
      Constructs a new BinaryHeap.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clears all elements from queue.
      T dequeue()
      Returns the Queueable on top of heap and remove it.
      void dequeue​(T activation)  
      void enqueue​(T element)
      Inserts an Queueable into queue.
      java.util.Collection<T> getAll()  
      boolean isEmpty()
      Tests if queue is empty.
      T peek()  
      void readExternal​(java.io.ObjectInput in)  
      int size()
      Returns the number of elements in this heap.
      java.lang.String toString()  
      void writeExternal​(java.io.ObjectOutput out)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • log

        protected static final org.slf4j.Logger log
    • Constructor Detail

      • TreeSetQueue

        public TreeSetQueue()
      • TreeSetQueue

        public TreeSetQueue​(java.util.Comparator<T> comparator)
        Constructs a new BinaryHeap.
        Parameters:
        comparator - the comparator used to order the elements, null means use natural order
    • Method Detail

      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • isEmpty

        public boolean isEmpty()
        Tests if queue is empty.
        Specified by:
        isEmpty in interface Queue<T extends Queue.QueueEntry>
        Returns:
        true if queue is empty; false otherwise.
      • size

        public int size()
        Returns the number of elements in this heap.
        Specified by:
        size in interface Queue<T extends Queue.QueueEntry>
        Returns:
        the number of elements in this heap
      • enqueue

        public void enqueue​(T element)
        Inserts an Queueable into queue.
        Specified by:
        enqueue in interface Queue<T extends Queue.QueueEntry>
        Parameters:
        element - the Queueable to be inserted
      • dequeue

        public T dequeue()
        Returns the Queueable on top of heap and remove it.
        Specified by:
        dequeue in interface Queue<T extends Queue.QueueEntry>
        Returns:
        the Queueable at top of heap
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object