Schnittstelle DoublePriorityQueue

Alle Superschnittstellen:
DoubleIterable, Iterable<Double>
Alle bekannten Unterschnittstellen:
DoublePriorityDequeue
Alle bekannten Implementierungsklassen:
AbstractDoublePriorityQueue, DoubleArrayFIFOQueue, DoubleArrayPriorityQueue, DoubleHeapPriorityQueue, DoubleLinkedList, DoublePriorityQueues.SynchronizedPriorityDequeue, DoublePriorityQueues.SynchronizedPriorityQueue

public interface DoublePriorityQueue extends DoubleIterable
A Simple PriorityQueue (or Queue) interface that provides with the nessesary functions to interact with it, without cluttering with the Collection interface.
  • Methodendetails

    • isEmpty

      default boolean isEmpty()
      Gibt zurück:
      true if the PriorityQueue is empty
    • size

      int size()
      Gibt zurück:
      the amount of elements that are stored in the PriorityQueue
    • clear

      void clear()
      clears all elements within the PriorityQueue, this does not resize the backing arrays
    • enqueue

      void enqueue(double e)
      Method to insert a element into the PriorityQueue
      Parameter:
      e - the element that should be inserted
    • enqueueAll

      default void enqueueAll(double... e)
      Method to mass insert elements into the PriorityQueue
      Parameter:
      e - the elements that should be inserted
    • enqueueAll

      default void enqueueAll(double[] e, int length)
      Method to mass insert elements into the PriorityQueue
      Parameter:
      e - the elements that should be inserted
      length - the amount of elements that should be inserted
    • enqueueAll

      default void enqueueAll(double[] e, int offset, int length)
      Method to mass insert elements into the PriorityQueue
      Parameter:
      e - the elements that should be inserted
      offset - the offset where in the array should be started
      length - the amount of elements that should be inserted
    • enqueueAll

      default void enqueueAll(DoubleCollection c)
      Method to mass insert elements into the PriorityQueue
      Parameter:
      c - the elements that should be inserted from the Collection
    • dequeue

      double dequeue()
      Method to extract a element from the PriorityQueue
      Gibt zurück:
      a element from the Queue
      Löst aus:
      NoSuchElementException - if no element is present
    • peek

      double peek(int index)
      Peeking function to see whats inside the queue.
      Parameter:
      index - of the element that is requested to be viewed.
      Gibt zurück:
      the element that is requested
    • first

      default double first()
      Shows the element that is to be returned next
      Gibt zurück:
      the first element in the Queue
    • contains

      boolean contains(double e)
      Method to find out if a element is part of the queue
      Parameter:
      e - the element that is searched for
      Gibt zurück:
      true if the element is in the queue
    • removeFirst

      boolean removeFirst(double e)
      Removes the first found element in the queue
      Parameter:
      e - the element that should be removed
      Gibt zurück:
      if a searched element was removed
    • removeLast

      boolean removeLast(double e)
      Removes the last found element in the queue
      Parameter:
      e - the element that should be removed
      Gibt zurück:
      if a searched element was removed
    • onChanged

      void onChanged()
      Allows to notify the Queue to be revalidate its data
    • copy

      A Function that does a shallow clone of the PriorityQueue itself. This function is more optimized then a copy constructor since the PriorityQueue does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk
      Gibt zurück:
      a Shallow Copy of the PriorityQueue
      Note:
      Wrappers and view PriorityQueues will not support this feature
    • comparator

      DoubleComparator comparator()
      Gibt zurück:
      the sorter of the Queue, can be null
    • synchronizeQueue

      default DoublePriorityQueue synchronizeQueue()
      Creates a Wrapped PriorityQueue that is Synchronized
      Gibt zurück:
      a new PriorityQueue that is synchronized
      Siehe auch:
    • synchronizeQueue

      default DoublePriorityQueue synchronizeQueue(Object mutex)
      Creates a Wrapped PriorityQueue that is Synchronized
      Parameter:
      mutex - is the controller of the synchronization block
      Gibt zurück:
      a new PriorityQueue Wrapper that is synchronized
      Siehe auch:
    • toDoubleArray

      default double[] toDoubleArray()
      A method to drop the contents of the Queue without clearing the queue
      Angegeben von:
      toDoubleArray in Schnittstelle DoubleIterable
      Gibt zurück:
      the contents of the queue into a seperate array.
    • toDoubleArray

      double[] toDoubleArray(double[] input)
      A method to drop the contents of the Queue without clearing the queue
      Parameter:
      input - where the elements should be inserted to. If it does not fit then it creates a new appropiatly created array
      Gibt zurück:
      the contents of the queue into a seperate array.
      Note:
      if the Type is generic then a Object Array is created instead of a Type Array