com.aliasi.util
Interface PriorityQueue<E>

Type Parameters:
E - the type of objects stored in the queue
All Superinterfaces:
Collection<E>, Iterable<E>
All Known Implementing Classes:
BoundedPriorityQueue

Deprecated. Use one of the implementations in applications, or Queue for the interface.

@Deprecated
public interface PriorityQueue<E>
extends Collection<E>

A PriorityQueue is an ordered collection that supports peek and pop methods to inspect and return the greatest element in the queue. Iterators for priority queues return the elements ordered from largest to smallest. Priority is typically defined by means of a comparator.

The ordering on which a priority queue is based need not be consistent with equals (see Comparator). Priority queues behave like sets with respect to natural object equality. Thus no two elements in the queue will be equal to each other as defined by Object.equals(Object). Priority queues behave like bags or multisets with respect to the priority ordering of objects. Thus it is acceptable for the priority ordering Comparator.compare(Object,Object) to return 0 for objects which are not naturally equal.

Since:
LingPipe2.0
Version:
3.8
Author:
Bob Carpenter
See Also:
Collection, Comparator

Method Summary
 E peek()
          Deprecated. Returns the largest element in the queue or null if the queue is empty.
 E pop()
          Deprecated. Remove and return the largest element in the queue or return null if the queue is empty.
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Method Detail

pop

E pop()
Deprecated. 
Remove and return the largest element in the queue or return null if the queue is empty.

Returns:
The largest element in the queue.

peek

E peek()
Deprecated. 
Returns the largest element in the queue or null if the queue is empty.

Returns:
The largest element in the queue or null if the queue is empty.