Schnittstelle ObjectPriorityQueue<T>

Typparameter:
T - the keyType of elements maintained by this Collection
Alle Superschnittstellen:
Iterable<T>, ObjectIterable<T>
Alle bekannten Unterschnittstellen:
ObjectPriorityDequeue<T>
Alle bekannten Implementierungsklassen:
AbstractObjectPriorityQueue, ObjectArrayFIFOQueue, ObjectArrayPriorityQueue, ObjectHeapPriorityQueue, ObjectLinkedList, ObjectPriorityQueues.SynchronizedPriorityDequeue, ObjectPriorityQueues.SynchronizedPriorityQueue

public interface ObjectPriorityQueue<T> extends ObjectIterable<T>
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(T e)
      Method to insert a element into the PriorityQueue
      Parameter:
      e - the element that should be inserted
    • enqueueAll

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

      default void enqueueAll(T[] 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(T[] 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(ObjectCollection<T> c)
      Method to mass insert elements into the PriorityQueue
      Parameter:
      c - the elements that should be inserted from the Collection
    • enqueueAll

      default void enqueueAll(Collection<? extends T> c)
      Method to mass insert elements into the PriorityQueue This method exists to add support for Java Collections to make it more useable
      Parameter:
      c - the elements that should be inserted from the Collection
    • dequeue

      T 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

      T 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 T first()
      Shows the element that is to be returned next
      Gibt zurück:
      the first element in the Queue
    • contains

      boolean contains(T 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(T 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(T 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

      Comparator<? super T> comparator()
      Gibt zurück:
      the sorter of the Queue, can be null
    • iterator

      ObjectIterator<T> iterator()
      Beschreibung aus Schnittstelle kopiert: ObjectIterable
      Returns an iterator over elements of type T.
      Angegeben von:
      iterator in Schnittstelle Iterable<T>
      Angegeben von:
      iterator in Schnittstelle ObjectIterable<T>
      Gibt zurück:
      draining iterator of the PriorityQueue
    • synchronizeQueue

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

      default ObjectPriorityQueue<T> 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:
    • toArray

      default <E> E[] toArray()
      A method to drop the contents of the Queue without clearing the queue
      Typparameter:
      E - the keyType of elements maintained by this Collection
      Gibt zurück:
      the contents of the queue into a seperate array.
    • toArray

      <E> E[] toArray(E[] input)
      A method to drop the contents of the Queue without clearing the queue
      Typparameter:
      E - the keyType of elements maintained by this Collection
      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
    • toArray

      default <E> E[] toArray(IntFunction<E[]> action)
      A Helper function that simplifies the process of creating a new Array.
      Angegeben von:
      toArray in Schnittstelle ObjectIterable<T>
      Typparameter:
      E - the returning arrayType
      Parameter:
      action - the array creation function
      Gibt zurück:
      an array containing all of the elements in this collection
      Siehe auch: