Package org.meteoinfo.jts.util
Class PriorityQueue
- java.lang.Object
-
- org.meteoinfo.jts.util.PriorityQueue
-
public class PriorityQueue extends java.lang.ObjectA priority queue over a set ofComparableobjects.
-
-
Constructor Summary
Constructors Constructor Description PriorityQueue()Creates a new empty priority queue
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Comparable x)Insert into the priority queue.voidclear()Make the priority queue logically empty.booleanisEmpty()Test if the priority queue is logically empty.java.lang.Objectpoll()Remove the smallest item from the priority queue.intsize()Returns size.
-
-
-
Method Detail
-
add
public void add(java.lang.Comparable x)
Insert into the priority queue. Duplicates are allowed.- Parameters:
x- the item to insert.
-
isEmpty
public boolean isEmpty()
Test if the priority queue is logically empty.- Returns:
- true if empty, false otherwise.
-
size
public int size()
Returns size.- Returns:
- current size.
-
clear
public void clear()
Make the priority queue logically empty.
-
poll
public java.lang.Object poll()
Remove the smallest item from the priority queue.- Returns:
- the smallest item, or null if empty
-
-