blob: 9e1c1463c858acbfff2851541e35d38e23a9578c [file] [log] [blame]
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Class PriorityQueue&lt;T&gt;
| Apache Lucene.NET 4.8.0 Documentation </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Class PriorityQueue&lt;T&gt;
| Apache Lucene.NET 4.8.0 Documentation ">
<meta name="generator" content="docfx 2.47.0.0">
<link rel="shortcut icon" href="../../logo/favicon.ico">
<link rel="stylesheet" href="../../styles/docfx.vendor.css">
<link rel="stylesheet" href="../../styles/docfx.css">
<link rel="stylesheet" href="../../styles/main.css">
<meta property="docfx:navrel" content="../../toc.html">
<meta property="docfx:tocrel" content="../toc.html">
<meta property="docfx:rel" content="../../">
</head>
<body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>
<nav id="autocollapse" class="navbar ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="../../index.html">
<img id="logo" class="svg" src="../../logo/lucene-net-color.png" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">
<div id="search-results">
<div class="search-list"></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">
<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="Lucene.Net.Support.PriorityQueue`1">
<h1 id="Lucene_Net_Support_PriorityQueue_1" data-uid="Lucene.Net.Support.PriorityQueue`1" class="text-break">Class PriorityQueue&lt;T&gt;
</h1>
<div class="markdown level0 summary"><p>A <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a> holds elements on a priority heap, which orders the elements
according to their natural order or according to the comparator specified at
construction time. If the queue uses natural ordering, only elements that are
comparable are permitted to be inserted into the queue.
<p>
The least element of the specified ordering is stored at the head of the
queue and the greatest element is stored at the tail of the queue.
<p>
A <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a> is not synchronized.</p>
</div>
<div class="markdown level0 conceptual"></div>
<div class="inheritance">
<h5>Inheritance</h5>
<div class="level0"><span class="xref">System.Object</span></div>
<div class="level1"><span class="xref">PriorityQueue&lt;T&gt;</span></div>
</div>
<div classs="implements">
<h5>Implements</h5>
<div><span class="xref">System.Collections.Generic.ICollection</span>&lt;T&gt;</div>
<div><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;T&gt;</div>
<div><span class="xref">System.Collections.IEnumerable</span></div>
</div>
<div class="inheritedMembers">
<h5>Inherited Members</h5>
<div>
<span class="xref">System.Object.Equals(System.Object)</span>
</div>
<div>
<span class="xref">System.Object.Equals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.GetHashCode()</span>
</div>
<div>
<span class="xref">System.Object.GetType()</span>
</div>
<div>
<span class="xref">System.Object.MemberwiseClone()</span>
</div>
<div>
<span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
</div>
<div>
<span class="xref">System.Object.ToString()</span>
</div>
</div>
<h6><strong>Namespace</strong>: <a class="xref" href="../Lucene.Net.Benchmarks/Lucene.Net.Support.html">Lucene.Net.Support</a></h6>
<h6><strong>Assembly</strong>: Lucene.Net.dll</h6>
<h5 id="Lucene_Net_Support_PriorityQueue_1_syntax">Syntax</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">[Serializable]
public class PriorityQueue&lt;T&gt; : ICollection&lt;T&gt;, IEnumerable&lt;T&gt;, IEnumerable where T : class</code></pre>
</div>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="parametername">T</span></td>
<td><p>Type of elements</p>
</td>
</tr>
</tbody>
</table>
<h3 id="constructors">Constructors
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L57">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor">PriorityQueue()</h4>
<div class="markdown level1 summary"><p>Constructs a priority queue with an initial capacity of 11 and natural
ordering.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue()</code></pre>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor_Lucene_Net_Support_PriorityQueue__0__.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor(Lucene.Net.Support.PriorityQueue%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L165">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor_Lucene_Net_Support_PriorityQueue__0__" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor(Lucene.Net.Support.PriorityQueue{`0})">PriorityQueue(PriorityQueue&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Creates a <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a> containing the elements in the
specified priority queue. This priority queue will be
ordered according to the same ordering as the given priority
queue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue(PriorityQueue&lt;T&gt; collection)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue</a>&lt;T&gt;</td>
<td><span class="parametername">collection</span></td>
<td><p>the priority queue whose elements are to be placed
into this priority queue</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.InvalidCastException</span></td>
<td><p>if elements of <code data-dev-comment-type="paramref" class="paramref">collection</code>
cannot be compared to one another according to <code data-dev-comment-type="paramref" class="paramref">collection</code>&apos;s
ordering</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor_Lucene_Net_Support_TreeSet__0__.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor(Lucene.Net.Support.TreeSet%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L219">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor_Lucene_Net_Support_TreeSet__0__" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor(Lucene.Net.Support.TreeSet{`0})">PriorityQueue(TreeSet&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Creates a <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a> containing the elements in the
specified <a class="xref" href="Lucene.Net.Support.TreeSet-1.html">TreeSet&lt;T&gt;</a>. This priority queue will be
ordered according to the same ordering as the given <a class="xref" href="Lucene.Net.Support.TreeSet-1.html">TreeSet&lt;T&gt;</a>.
<p>
The constructed priority queue has the initial capacity of 110% of the
size of the sorted set. The priority queue will have the same comparator
as the sorted set.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue(TreeSet&lt;T&gt; collection)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><a class="xref" href="Lucene.Net.Support.TreeSet-1.html">TreeSet</a>&lt;T&gt;</td>
<td><span class="parametername">collection</span></td>
<td><p>the sorted set whose elements are to be placed
into this priority queue</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.InvalidCastException</span></td>
<td><p>if elements of <code data-dev-comment-type="paramref" class="paramref">collection</code>
cannot be compared to one another according to <code data-dev-comment-type="paramref" class="paramref">collection</code>&apos;s
ordering</p>
</td>
</tr>
<tr>
<td><span class="xref">System.ArgumentNullException</span></td>
<td><p>if the specified collection or any
of its elements are null</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor_System_Collections_Generic_ICollection__0__.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor(System.Collections.Generic.ICollection%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L125">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor_System_Collections_Generic_ICollection__0__" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor(System.Collections.Generic.ICollection{`0})">PriorityQueue(ICollection&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Creates a <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a> containing the elements in the
specified collection. If the specified collection is an instance of
a <span class="xref">System.Collections.Generic.SortedSet&lt;T&gt;</span>, <a class="xref" href="Lucene.Net.Support.TreeSet-1.html">TreeSet&lt;T&gt;</a>,
or is another <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a>, this
priority queue will be ordered according to the same ordering.
Otherwise, this priority queue will be ordered according to the
<span class="xref">System.IComparable&lt;T&gt;</span> natural ordering of its elements.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue(ICollection&lt;T&gt; collection)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.ICollection</span>&lt;T&gt;</td>
<td><span class="parametername">collection</span></td>
<td><p>collection to be inserted into priority queue</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.InvalidCastException</span></td>
<td><p>if elements of the specified collection
cannot be compared to one another according to the priority
queue&apos;s ordering</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor_System_Collections_Generic_IComparer__0__.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor(System.Collections.Generic.IComparer%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L103">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor_System_Collections_Generic_IComparer__0__" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor(System.Collections.Generic.IComparer{`0})">PriorityQueue(IComparer&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Constructs a priority queue with the specified capacity and comparer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue(IComparer&lt;T&gt; comparer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.IComparer</span>&lt;T&gt;</td>
<td><span class="parametername">comparer</span></td>
<td><p>The <span class="xref">System.Collections.Generic.IComparer&lt;T&gt;</span> that will be used to order this
priority queue. If <code>null</code>, the <span class="xref">System.IComparable&lt;T&gt;</span>
natural ordering of the elements will be used.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor_System_Collections_Generic_SortedSet__0__.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor(System.Collections.Generic.SortedSet%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L192">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor_System_Collections_Generic_SortedSet__0__" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor(System.Collections.Generic.SortedSet{`0})">PriorityQueue(SortedSet&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Creates a <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a> containing the elements in the
specified <span class="xref">System.Collections.Generic.SortedSet&lt;T&gt;</span>. This priority queue will be
ordered according to the same ordering as the given <span class="xref">System.Collections.Generic.SortedSet&lt;T&gt;</span>.
<p>
The constructed priority queue has the initial capacity of 110% of the
size of the sorted set. The priority queue will have the same comparator
as the sorted set.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue(SortedSet&lt;T&gt; collection)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.SortedSet</span>&lt;T&gt;</td>
<td><span class="parametername">collection</span></td>
<td><p>the sorted set whose elements are to be placed
into this priority queue</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.InvalidCastException</span></td>
<td><p>if elements of <code data-dev-comment-type="paramref" class="paramref">collection</code>
cannot be compared to one another according to <code data-dev-comment-type="paramref" class="paramref">collection</code>&apos;s
ordering</p>
</td>
</tr>
<tr>
<td><span class="xref">System.ArgumentNullException</span></td>
<td><p>if the specified collection or any
of its elements are null</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor_System_Int32_.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor(System.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L68">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor_System_Int32_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor(System.Int32)">PriorityQueue(Int32)</h4>
<div class="markdown level1 summary"><p>Constructs a priority queue with the specified capacity and natural
ordering.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue(int initialCapacity)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">initialCapacity</span></td>
<td><p>initial capacity</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.ArgumentOutOfRangeException</span></td>
<td><p>if the <code data-dev-comment-type="paramref" class="paramref">initialCapacity</code> is less than 1.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1__ctor_System_Int32_System_Collections_Generic_IComparer__0__.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.%23ctor(System.Int32%2CSystem.Collections.Generic.IComparer%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L84">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1__ctor_" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1__ctor_System_Int32_System_Collections_Generic_IComparer__0__" data-uid="Lucene.Net.Support.PriorityQueue`1.#ctor(System.Int32,System.Collections.Generic.IComparer{`0})">PriorityQueue(Int32, IComparer&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>Creates a <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html">PriorityQueue&lt;T&gt;</a> with the specified initial capacity
that orders its elements according to the specified comparer.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public PriorityQueue(int initialCapacity, IComparer&lt;T&gt; comparer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">initialCapacity</span></td>
<td><p>the initial capacity for this priority queue</p>
</td>
</tr>
<tr>
<td><span class="xref">System.Collections.Generic.IComparer</span>&lt;T&gt;</td>
<td><span class="parametername">comparer</span></td>
<td><p>The <span class="xref">System.Collections.Generic.IComparer&lt;T&gt;</span> that will be used to order this
priority queue. If <code>null</code>, the <span class="xref">System.IComparable&lt;T&gt;</span>
natural ordering of the elements will be used.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.ArgumentOutOfRangeException</span></td>
<td><p>if the <code data-dev-comment-type="paramref" class="paramref">initialCapacity</code> is less than 1</p>
</td>
</tr>
</tbody>
</table>
<h3 id="properties">Properties
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Comparer.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Comparer%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L350">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Comparer_" data-uid="Lucene.Net.Support.PriorityQueue`1.Comparer*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Comparer" data-uid="Lucene.Net.Support.PriorityQueue`1.Comparer">Comparer</h4>
<div class="markdown level1 summary"><p>Gets the <span class="xref">System.Collections.Generic.IComparer&lt;T&gt;</span> used to order the elements in this
queue, or <span class="xref">Lucene.Net.Util.ArrayUtil.NaturalComparer`1</span> if this queue is sorted according to
the <span class="xref">System.IComparable&lt;T&gt;</span> natural ordering of its elements.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual IComparer&lt;T&gt; Comparer { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.IComparer</span>&lt;T&gt;</td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Count.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Count%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L286">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Count_" data-uid="Lucene.Net.Support.PriorityQueue`1.Count*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Count" data-uid="Lucene.Net.Support.PriorityQueue`1.Count">Count</h4>
<div class="markdown level1 summary"><p>Gets the size of the priority queue. If the size of the queue is greater
than the <span class="xref">System.Int32.MaxValue</span>, then it returns <span class="xref">System.Int32.MaxValue</span>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual int Count { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Int32</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_IsReadOnly.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.IsReadOnly%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L665">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_IsReadOnly_" data-uid="Lucene.Net.Support.PriorityQueue`1.IsReadOnly*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_IsReadOnly" data-uid="Lucene.Net.Support.PriorityQueue`1.IsReadOnly">IsReadOnly</h4>
<div class="markdown level1 summary"><p>Gets a value indicating whether the collection is read-only.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual bool IsReadOnly { get; }</code></pre>
</div>
<h5 class="propertyValue">Property Value</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 id="Lucene_Net_Support_PriorityQueue_1_IsReadOnly_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>For priority queue this property returns <code>false</code>.</p>
</div>
<h3 id="methods">Methods
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Add__0_.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Add(%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L382">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Add_" data-uid="Lucene.Net.Support.PriorityQueue`1.Add*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Add__0_" data-uid="Lucene.Net.Support.PriorityQueue`1.Add(`0)">Add(T)</h4>
<div class="markdown level1 summary"><p>Adds the specified object to the priority queue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual void Add(T item)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">item</span></td>
<td><p>the object to be added.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.InvalidCastException</span></td>
<td><p>if the specified element cannot be
compared with elements currently in this priority queue
according to the priority queue&apos;s ordering</p>
</td>
</tr>
<tr>
<td><span class="xref">System.ArgumentNullException</span></td>
<td><p>if <code data-dev-comment-type="paramref" class="paramref">item</code> is <code>null</code>.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_AddAll_System_Collections_Generic_ICollection__0__.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.AddAll(System.Collections.Generic.ICollection%7B%600%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L542">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_AddAll_" data-uid="Lucene.Net.Support.PriorityQueue`1.AddAll*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_AddAll_System_Collections_Generic_ICollection__0__" data-uid="Lucene.Net.Support.PriorityQueue`1.AddAll(System.Collections.Generic.ICollection{`0})">AddAll(ICollection&lt;T&gt;)</h4>
<div class="markdown level1 summary"></div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual bool AddAll(ICollection&lt;T&gt; collection)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.ICollection</span>&lt;T&gt;</td>
<td><span class="parametername">collection</span></td>
<td></td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td></td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Clear.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Clear%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L294">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Clear_" data-uid="Lucene.Net.Support.PriorityQueue`1.Clear*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Clear" data-uid="Lucene.Net.Support.PriorityQueue`1.Clear">Clear()</h4>
<div class="markdown level1 summary"><p>Removes all of the elements from this priority queue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual void Clear()</code></pre>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Contains__0_.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Contains(%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L629">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Contains_" data-uid="Lucene.Net.Support.PriorityQueue`1.Contains*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Contains__0_" data-uid="Lucene.Net.Support.PriorityQueue`1.Contains(`0)">Contains(T)</h4>
<div class="markdown level1 summary"><p>Returns <code>true</code> if this queue contains the specified element.
More formally, returns <code>true</code> if and only if this queue contains
at least one element <code data-dev-comment-type="paramref" class="paramref">item</code> such that <code>o.Equals(item)</code>.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual bool Contains(T item)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">item</span></td>
<td><p>The object to locate in the priority queue</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p><code>true</code> if item is found in the priority queue; otherwise, <code>false.</code> </p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_CopyTo__0___System_Int32_.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.CopyTo(%600%5B%5D%2CSystem.Int32)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L642">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_CopyTo_" data-uid="Lucene.Net.Support.PriorityQueue`1.CopyTo*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_CopyTo__0___System_Int32_" data-uid="Lucene.Net.Support.PriorityQueue`1.CopyTo(`0[],System.Int32)">CopyTo(T[], Int32)</h4>
<div class="markdown level1 summary"><p>Copies the elements of the priority queue to an Array, starting at a particular Array index.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual void CopyTo(T[] array, int arrayIndex)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>T[]</td>
<td><span class="parametername">array</span></td>
<td><p>The one-dimensional Array that is the destination of the elements copied from the priority queue. The Array must have zero-based indexing. </p>
</td>
</tr>
<tr>
<td><span class="xref">System.Int32</span></td>
<td><span class="parametername">arrayIndex</span></td>
<td><p>The zero-based index in array at which copying begins.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="Lucene_Net_Support_PriorityQueue_1_CopyTo__0___System_Int32__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>It is not guaranteed that items will be copied in the sorted order.</p>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Element.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Element%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L597">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Element_" data-uid="Lucene.Net.Support.PriorityQueue`1.Element*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Element" data-uid="Lucene.Net.Support.PriorityQueue`1.Element">Element()</h4>
<div class="markdown level1 summary"><p>Retrieves, but does not remove, the head of this queue. This method
differs from <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html#Lucene_Net_Support_PriorityQueue_1_Peek">Peek()</a> only in that it throws an exception if
this queue is empty.
<p>
This implementation returns the result of <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html#Lucene_Net_Support_PriorityQueue_1_Peek">Peek()</a>
unless the queue is empty.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual T Element()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p>the head of this queue</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.KeyNotFoundException</span></td>
<td><p>if this queue is empty</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_GetEnumerator.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.GetEnumerator%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L277">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_GetEnumerator_" data-uid="Lucene.Net.Support.PriorityQueue`1.GetEnumerator*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_GetEnumerator" data-uid="Lucene.Net.Support.PriorityQueue`1.GetEnumerator">GetEnumerator()</h4>
<div class="markdown level1 summary"><p>Gets the enumerator of the priority queue, which will not return elements
in any specified ordering.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual IEnumerator&lt;T&gt; GetEnumerator()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.IEnumerator</span>&lt;T&gt;</td>
<td><p>The enumerator of the priority queue.</p>
</td>
</tr>
</tbody>
</table>
<h5 id="Lucene_Net_Support_PriorityQueue_1_GetEnumerator_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Returned enumerator does not iterate elements in sorted order.</p>
</div>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Offer__0_.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Offer(%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L309">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Offer_" data-uid="Lucene.Net.Support.PriorityQueue`1.Offer*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Offer__0_" data-uid="Lucene.Net.Support.PriorityQueue`1.Offer(`0)">Offer(T)</h4>
<div class="markdown level1 summary"><p>Inserts the specified element into this priority queue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual bool Offer(T item)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">item</span></td>
<td><p>the element to add to the priority queue.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p>always <code>true</code></p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.InvalidCastException</span></td>
<td><p>if the specified element cannot be
compared with elements currently in this priority queue
according to the priority queue&apos;s ordering</p>
</td>
</tr>
<tr>
<td><span class="xref">System.ArgumentNullException</span></td>
<td><p>if the specified element is null</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Peek.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Peek%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L340">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Peek_" data-uid="Lucene.Net.Support.PriorityQueue`1.Peek*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Peek" data-uid="Lucene.Net.Support.PriorityQueue`1.Peek">Peek()</h4>
<div class="markdown level1 summary"><p>Gets but does not remove the head of the queue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual T Peek()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p>the head of the queue or null if the queue is empty.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Poll.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Poll%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L325">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Poll_" data-uid="Lucene.Net.Support.PriorityQueue`1.Poll*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Poll" data-uid="Lucene.Net.Support.PriorityQueue`1.Poll">Poll()</h4>
<div class="markdown level1 summary"><p>Gets and removes the head of the queue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual T Poll()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p>the head of the queue or null if the queue is empty.</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Remove.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Remove%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L577">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Remove_" data-uid="Lucene.Net.Support.PriorityQueue`1.Remove*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Remove" data-uid="Lucene.Net.Support.PriorityQueue`1.Remove">Remove()</h4>
<div class="markdown level1 summary"><p>Retrieves and removes the head of this queue. This method differs
from <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html#Lucene_Net_Support_PriorityQueue_1_Poll">Poll()</a> only in that it throws an exception if this
queue is empty.
<p>
This implementation returns the result of <a class="xref" href="Lucene.Net.Support.PriorityQueue-1.html#Lucene_Net_Support_PriorityQueue_1_Poll">Poll()</a>
unless the queue is empty.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual T Remove()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><p>the head of this queue</p>
</td>
</tr>
</tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.Generic.KeyNotFoundException</span></td>
<td><p>if this queue is empty</p>
</td>
</tr>
</tbody>
</table>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_Remove__0_.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.Remove(%600)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L357">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_Remove_" data-uid="Lucene.Net.Support.PriorityQueue`1.Remove*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_Remove__0_" data-uid="Lucene.Net.Support.PriorityQueue`1.Remove(`0)">Remove(T)</h4>
<div class="markdown level1 summary"><p>Removes the specified object from the priority queue.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">public virtual bool Remove(T item)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">T</span></td>
<td><span class="parametername">item</span></td>
<td><p>the object to be removed.</p>
</td>
</tr>
</tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Boolean</span></td>
<td><p><code>true</code> if the object was in the priority queue, <code>false</code> if the object</p>
</td>
</tr>
</tbody>
</table>
<h3 id="eii">Explicit Interface Implementations
</h3>
<span class="small pull-right mobile-hide">
<span class="divider">|</span>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1_System_Collections_IEnumerable_GetEnumerator.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601.System%23Collections%23IEnumerable%23GetEnumerator%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
</span>
<span class="small pull-right mobile-hide">
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L676">View Source</a>
</span>
<a id="Lucene_Net_Support_PriorityQueue_1_System_Collections_IEnumerable_GetEnumerator_" data-uid="Lucene.Net.Support.PriorityQueue`1.System#Collections#IEnumerable#GetEnumerator*"></a>
<h4 id="Lucene_Net_Support_PriorityQueue_1_System_Collections_IEnumerable_GetEnumerator" data-uid="Lucene.Net.Support.PriorityQueue`1.System#Collections#IEnumerable#GetEnumerator">IEnumerable.GetEnumerator()</h4>
<div class="markdown level1 summary"><p>Returns an enumerator that iterates through the collection.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="decalaration">Declaration</h5>
<div class="codewrapper">
<pre><code class="lang-csharp hljs">IEnumerator IEnumerable.GetEnumerator()</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><span class="xref">System.Collections.IEnumerator</span></td>
<td><p>Enumerator</p>
</td>
</tr>
</tbody>
</table>
<h5 id="Lucene_Net_Support_PriorityQueue_1_System_Collections_IEnumerable_GetEnumerator_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Returned enumerator does not iterate elements in sorted order.</p>
</div>
<h3 id="implements">Implements</h3>
<div>
<span class="xref">System.Collections.Generic.ICollection&lt;T&gt;</span>
</div>
<div>
<span class="xref">System.Collections.Generic.IEnumerable&lt;T&gt;</span>
</div>
<div>
<span class="xref">System.Collections.IEnumerable</span>
</div>
<h3 id="extensionmethods">Extension Methods</h3>
<div>
<a class="xref" href="Lucene.Net.Support.EnumerableExtensions.html#Lucene_Net_Support_EnumerableExtensions_InPairs__2_System_Collections_Generic_IEnumerable___0__System_Func___0___0___1__">EnumerableExtensions.InPairs&lt;T, TOut&gt;(IEnumerable&lt;T&gt;, Func&lt;T, T, TOut&gt;)</a>
</div>
<div>
<a class="xref" href="Lucene.Net.Support.EnumerableExtensions.html#Lucene_Net_Support_EnumerableExtensions_TakeAllButLast__1_System_Collections_Generic_IEnumerable___0__">EnumerableExtensions.TakeAllButLast&lt;T&gt;(IEnumerable&lt;T&gt;)</a>
</div>
<div>
<a class="xref" href="Lucene.Net.Support.EnumerableExtensions.html#Lucene_Net_Support_EnumerableExtensions_TakeAllButLast__1_System_Collections_Generic_IEnumerable___0__System_Int32_">EnumerableExtensions.TakeAllButLast&lt;T&gt;(IEnumerable&lt;T&gt;, Int32)</a>
</div>
<div>
<a class="xref" href="Lucene.Net.Support.SetExtensions.html#Lucene_Net_Support_SetExtensions_RemoveAll__1_System_Collections_Generic_ICollection___0__System_Collections_Generic_IEnumerable___0__">SetExtensions.RemoveAll&lt;T&gt;(ICollection&lt;T&gt;, IEnumerable&lt;T&gt;)</a>
</div>
</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<div class="contribution">
<ul class="nav">
<li>
<a href="https://github.com/apache/lucenenet/new/docs-4.8.0-beta00007/websites/apidocs/apiSpec/new?filename=Lucene_Net_Support_PriorityQueue_1.md&amp;value=---%0Auid%3A%20Lucene.Net.Support.PriorityQueue%601%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
</li>
<li>
<a href="https://github.com/Shazwazza/lucenenet/blob/docs-update-jan2020/src/Lucene.Net/Support/PriorityQueue.cs/#L40" class="contribution-link">View Source</a>
</li>
</ul>
</div>
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
</nav>
</div>
</div>
</div>
</div>
<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
Copyright © 2020 Licensed to the Apache Software Foundation (ASF)
</div>
</div>
</footer>
</div>
<script type="text/javascript" src="../../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../../styles/docfx.js"></script>
<script type="text/javascript" src="../../styles/main.js"></script>
</body>
</html>