Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.collections
Interface PriorityQueue

All Known Implementing Classes:
  BinaryHeap, SynchronizedPriorityQueue

Deprecated. Replaced by the Buffer interface and implementations in buffer subpackage. Due to be removed in v4.0.

public interface PriorityQueue

Defines a collection for priority queues, which can insert, peek and pop.

This interface is now replaced by the `Buffer` interface.

Since:
  Commons Collections 1.0
Version:
  $Revision: 1.14 $ $Date: 2004/02/18 01:15:42 $
Author:
  Peter Donald

Method Summary
`void` | `clear()` Deprecated. Clear all elements from queue.
`void` | `insert(Object element)` Deprecated. Insert an element into queue.
`boolean` | `isEmpty()` Deprecated. Test if queue is empty.
`Object` | `peek()` Deprecated. Return element on top of heap but don't remove it.
`Object` | `pop()` Deprecated. Return element on top of heap and remove it.

Method Detail

### clear

    public void clear()

  Deprecated.
  Clear all elements from queue.

### isEmpty

    public boolean isEmpty()

  Deprecated.
  Test if queue is empty.

  Returns:
    true if queue is empty else false.

### insert

    public void insert(Object element)

  Deprecated.
  Insert an element into queue.

  Parameters:
    `element` - the element to be inserted
  Throws:
    `ClassCastException` - if the specified `element`'s type prevents it from being compared to other items in the queue to determine its relative priority.

### peek

    public Object peek()

  Deprecated.
  Return element on top of heap but don't remove it.

  Returns:
    the element at top of heap
  Throws:
    `NoSuchElementException` - if `isEmpty() == true`

### pop

    public Object pop()

  Deprecated.
  Return element on top of heap and remove it.

  Returns:
    the element at top of heap
  Throws:
    `NoSuchElementException` - if `isEmpty() == true`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2004 Apache Software Foundation. All Rights Reserved.