Documentation of 'jsat.utils.IntPriorityQueue' Java class
IntPriorityQueue
jsat.utils

Class IntPriorityQueue

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<java.lang.Integer>, java.util.Collection<java.lang.Integer>, java.util.Queue<java.lang.Integer>


    public class IntPriorityQueue
    extends java.util.AbstractQueue<java.lang.Integer>
    implements java.io.Serializable
    This class represents a priority queue specifically designed to contain integer keys, and uses less memory then a PriorityQueue filled with integers. This queue can optionally support log(n) removal of key values at increased memory cost.
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  IntPriorityQueue.Mode
      Sets the mode used for the priority queue.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.util.Comparator<java.lang.Integer> naturalComparator 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void clear() 
      boolean contains(java.lang.Object o) 
      java.util.Iterator<java.lang.Integer> iterator() 
      boolean offer(int e) 
      boolean offer(java.lang.Integer e) 
      java.lang.Integer peek() 
      java.lang.Integer poll() 
      boolean remove(java.lang.Object o) 
      int size() 
      • Methods inherited from class java.util.AbstractQueue

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

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

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

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

        forEach
    • Field Detail

      • naturalComparator

        public static final java.util.Comparator<java.lang.Integer> naturalComparator
    • Constructor Detail

      • IntPriorityQueue

        public IntPriorityQueue(int initialSize,
                                java.util.Comparator<java.lang.Integer> comparator)
        Creates a new integer priority queue using the specified comparison and IntPriorityQueue.Mode.STANDARD
        Parameters:
        initialSize - the initial storage size of the queue
        comparator - the comparator to determine the order of elements in the queue
      • IntPriorityQueue

        public IntPriorityQueue(int initialSize,
                                IntPriorityQueue.Mode fastValueRemove)
        Creates a new integer priority queue
        Parameters:
        initialSize - the initial storage size of the queue
        fastValueRemove - the mode that whether or not, and how, fast arbitrary object removal from the queue will be done.
      • IntPriorityQueue

        public IntPriorityQueue(int initialSize,
                                java.util.Comparator<java.lang.Integer> comparator,
                                IntPriorityQueue.Mode fastValueRemove)
        Creates a new integer priority queue
        Parameters:
        initialSize - the initial storage size of the queue
        comparator - the comparator to determine the order of elements in the queue
        fastValueRemove - the mode that whether or not, and how, fast arbitrary object removal from the queue will be done.
    • Method Detail

      • iterator

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

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.Integer>
        Specified by:
        size in class java.util.AbstractCollection<java.lang.Integer>
      • offer

        public boolean offer(java.lang.Integer e)
        Specified by:
        offer in interface java.util.Queue<java.lang.Integer>
      • offer

        public boolean offer(int e)
      • poll

        public java.lang.Integer poll()
        Specified by:
        poll in interface java.util.Queue<java.lang.Integer>
      • peek

        public java.lang.Integer peek()
        Specified by:
        peek in interface java.util.Queue<java.lang.Integer>
      • contains

        public boolean contains(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<java.lang.Integer>
        Overrides:
        contains in class java.util.AbstractCollection<java.lang.Integer>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<java.lang.Integer>
        Overrides:
        clear in class java.util.AbstractQueue<java.lang.Integer>
      • remove

        public boolean remove(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<java.lang.Integer>
        Overrides:
        remove in class java.util.AbstractCollection<java.lang.Integer>

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.