Klasse LongPriorityQueues.SynchronizedPriorityQueue

java.lang.Object
speiger.src.collections.longs.utils.LongPriorityQueues.SynchronizedPriorityQueue
Alle implementierten Schnittstellen:
Iterable<Long>, LongIterable, LongPriorityQueue
Bekannte direkte Unterklassen:
LongPriorityQueues.SynchronizedPriorityDequeue
Umschließende Klasse:
LongPriorityQueues

public static class LongPriorityQueues.SynchronizedPriorityQueue extends Object implements LongPriorityQueue
Wrapper class for synchronization
  • Methodendetails

    • iterator

      public LongIterator iterator()
      Beschreibung aus Schnittstelle kopiert: LongIterable
      Returns an iterator over elements of type T.
      Angegeben von:
      iterator in Schnittstelle Iterable<Long>
      Angegeben von:
      iterator in Schnittstelle LongIterable
      Gibt zurück:
      an Iterator.
    • size

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

      public void clear()
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      clears all elements within the PriorityQueue, this does not resize the backing arrays
      Angegeben von:
      clear in Schnittstelle LongPriorityQueue
    • enqueue

      public void enqueue(long e)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Method to insert a element into the PriorityQueue
      Angegeben von:
      enqueue in Schnittstelle LongPriorityQueue
      Parameter:
      e - the element that should be inserted
    • enqueueAll

      public void enqueueAll(long[] e, int offset, int length)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Method to mass insert elements into the PriorityQueue
      Angegeben von:
      enqueueAll in Schnittstelle LongPriorityQueue
      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

      public void enqueueAll(LongCollection c)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Method to mass insert elements into the PriorityQueue
      Angegeben von:
      enqueueAll in Schnittstelle LongPriorityQueue
      Parameter:
      c - the elements that should be inserted from the Collection
    • dequeue

      public long dequeue()
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Method to extract a element from the PriorityQueue
      Angegeben von:
      dequeue in Schnittstelle LongPriorityQueue
      Gibt zurück:
      a element from the Queue
    • peek

      public long peek(int index)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Peeking function to see whats inside the queue.
      Angegeben von:
      peek in Schnittstelle LongPriorityQueue
      Parameter:
      index - of the element that is requested to be viewed.
      Gibt zurück:
      the element that is requested
    • contains

      public boolean contains(long e)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Method to find out if a element is part of the queue
      Angegeben von:
      contains in Schnittstelle LongPriorityQueue
      Parameter:
      e - the element that is searched for
      Gibt zurück:
      true if the element is in the queue
    • removeFirst

      public boolean removeFirst(long e)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Removes the first found element in the queue
      Angegeben von:
      removeFirst in Schnittstelle LongPriorityQueue
      Parameter:
      e - the element that should be removed
      Gibt zurück:
      if a searched element was removed
    • removeLast

      public boolean removeLast(long e)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Removes the last found element in the queue
      Angegeben von:
      removeLast in Schnittstelle LongPriorityQueue
      Parameter:
      e - the element that should be removed
      Gibt zurück:
      if a searched element was removed
    • onChanged

      public void onChanged()
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      Allows to notify the Queue to be revalidate its data
      Angegeben von:
      onChanged in Schnittstelle LongPriorityQueue
    • comparator

      public LongComparator comparator()
      Angegeben von:
      comparator in Schnittstelle LongPriorityQueue
      Gibt zurück:
      the sorter of the Queue, can be null
    • toLongArray

      public long[] toLongArray(long[] input)
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      A method to drop the contents of the Queue without clearing the queue
      Angegeben von:
      toLongArray in Schnittstelle LongPriorityQueue
      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.
    • copy

      public LongPriorityQueue copy()
      Beschreibung aus Schnittstelle kopiert: LongPriorityQueue
      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
      Angegeben von:
      copy in Schnittstelle LongPriorityQueue
      Gibt zurück:
      a Shallow Copy of the PriorityQueue
    • forEach

      public void forEach(LongConsumer action)
      Beschreibung aus Schnittstelle kopiert: LongIterable
      A Type Specific foreach function that reduces (un)boxing
      Angegeben von:
      forEach in Schnittstelle LongIterable
      Parameter:
      action - The action to be performed for each element
      Siehe auch:
    • forEach

      public <E> void forEach(E input, ObjectLongConsumer<E> action)
      Beschreibung aus Schnittstelle kopiert: LongIterable
      Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
      Angegeben von:
      forEach in Schnittstelle LongIterable
      Typparameter:
      E - the generic type of the Object
      Parameter:
      input - the object that should be included
      action - The action to be performed for each element
    • matchesAny

      public boolean matchesAny(LongPredicate filter)
      Beschreibung aus Schnittstelle kopiert: LongIterable
      Helper function to reduce stream usage that allows to filter for any matches.
      Angegeben von:
      matchesAny in Schnittstelle LongIterable
      Parameter:
      filter - that should be applied
      Gibt zurück:
      true if any matches were found
    • matchesNone

      public boolean matchesNone(LongPredicate filter)
      Beschreibung aus Schnittstelle kopiert: LongIterable
      Helper function to reduce stream usage that allows to filter for no matches.
      Angegeben von:
      matchesNone in Schnittstelle LongIterable
      Parameter:
      filter - that should be applied
      Gibt zurück:
      true if no matches were found
    • matchesAll

      public boolean matchesAll(LongPredicate filter)
      Beschreibung aus Schnittstelle kopiert: LongIterable
      Helper function to reduce stream usage that allows to filter for all matches.
      Angegeben von:
      matchesAll in Schnittstelle LongIterable
      Parameter:
      filter - that should be applied
      Gibt zurück:
      true if all matches.
    • findFirst

      public long findFirst(LongPredicate filter)
      Beschreibung aus Schnittstelle kopiert: LongIterable
      Helper function to reduce stream usage that allows to filter for the first match.
      Angegeben von:
      findFirst in Schnittstelle LongIterable
      Parameter:
      filter - that should be applied
      Gibt zurück:
      the found value or the null equivalent variant.
    • count

      public int count(LongPredicate filter)
      Beschreibung aus Schnittstelle kopiert: LongIterable
      Helper function to reduce stream usage that allows to count the valid elements.
      Angegeben von:
      count in Schnittstelle LongIterable
      Parameter:
      filter - that should be applied
      Gibt zurück:
      the amount of Valid Elements