org.apache.ignite.internal.util

## Class GridBoundedPriorityQueue<E>

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractQueue<E>
    - - java.util.PriorityQueue<E>
      - - org.apache.ignite.internal.util.GridBoundedPriorityQueue<E>

Type Parameters:
  `E` - Type of the queue element.

All Implemented Interfaces:
  Serializable, Iterable<E>, Collection<E>, Queue<E>

    public class GridBoundedPriorityQueue<E>
    extends PriorityQueue<E>

Bounded variant of `PriorityQueue`.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridBoundedPriorityQueue(int maxCap, Comparator<? super E> cmp)` Creates a bounded priority queue with the specified maximum size.

### Method Summary

Methods
`boolean` `offer(E e)`

### Methods inherited from class java.util.PriorityQueue

`add, clear, comparator, contains, iterator, peek, poll, remove, size, toArray, toArray`

### Methods inherited from class java.util.AbstractQueue

`addAll, element, remove`

### Methods inherited from class java.util.AbstractCollection

`containsAll, isEmpty, removeAll, retainAll, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface java.util.Collection

`containsAll, equals, hashCode, isEmpty, removeAll, retainAll`

### Constructor Detail

#### GridBoundedPriorityQueue

    public GridBoundedPriorityQueue(int maxCap,
                            Comparator<? super E> cmp)

Creates a bounded priority queue with the specified maximum size. At most `maxCap` elements would be kept in the queue.

Parameters:
  `maxCap` - Maximum size of the queue.
  `cmp` - Comparator that orders the elements.

### Method Detail

#### offer

    public boolean offer(E e)

Specified by:
  `offer` in interface `Queue<E>`
Overrides:
  `offer` in class `PriorityQueue<E>`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.8.0
Release Date | : December 5 2016