source: sandbox/expresso-solr/solr/docs/api/org/apache/solr/util/LongPriorityQueue.html @ 7588

Revision 7588, 24.5 KB checked in by adir, 11 years ago (diff)

Ticket #000 - Adicionando a integracao de buscas com Solr na base a ser isnerida na comunidade

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<!--NewPage-->
3<HTML>
4<HEAD>
5<!-- Generated by javadoc (build 1.6.0_24) on Mon Jun 25 15:26:26 EDT 2012 -->
6<META http-equiv="Content-Type" content="text/html; charset=utf-8">
7<TITLE>
8LongPriorityQueue (Solr 4.0.0-ALPHA API)
9</TITLE>
10
11<META NAME="date" CONTENT="2012-06-25">
12
13<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
14
15<SCRIPT type="text/javascript">
16function windowTitle()
17{
18    if (location.href.indexOf('is-external=true') == -1) {
19        parent.document.title="LongPriorityQueue (Solr 4.0.0-ALPHA API)";
20    }
21}
22</SCRIPT>
23<NOSCRIPT>
24</NOSCRIPT>
25
26</HEAD>
27
28<BODY BGCOLOR="white" onload="windowTitle();">
29<HR>
30
31
32<!-- ========= START OF TOP NAVBAR ======= -->
33<A NAME="navbar_top"><!-- --></A>
34<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
35<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
36<TR>
37<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
38<A NAME="navbar_top_firstrow"><!-- --></A>
39<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
40  <TR ALIGN="center" VALIGN="top">
41  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
42  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
43  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
44  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/LongPriorityQueue.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
45  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
46  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
47  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
48  </TR>
49</TABLE>
50</TD>
51<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
52</EM>
53</TD>
54</TR>
55
56<TR>
57<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
58&nbsp;<A HREF="../../../../org/apache/solr/util/FileUtils.html" title="class in org.apache.solr.util"><B>PREV CLASS</B></A>&nbsp;
59&nbsp;<A HREF="../../../../org/apache/solr/util/NumberUtils.html" title="class in org.apache.solr.util"><B>NEXT CLASS</B></A></FONT></TD>
60<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
61  <A HREF="../../../../index.html?org/apache/solr/util/LongPriorityQueue.html" target="_top"><B>FRAMES</B></A>  &nbsp;
62&nbsp;<A HREF="LongPriorityQueue.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
63&nbsp;<SCRIPT type="text/javascript">
64  <!--
65  if(window==top) {
66    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
67  }
68  //-->
69</SCRIPT>
70<NOSCRIPT>
71  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
72</NOSCRIPT>
73
74
75</FONT></TD>
76</TR>
77<TR>
78<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
79  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
80<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
81DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
82</TR>
83</TABLE>
84<A NAME="skip-navbar_top"></A>
85<!-- ========= END OF TOP NAVBAR ========= -->
86
87<HR>
88<!-- ======== START OF CLASS DATA ======== -->
89<H2>
90<FONT SIZE="-1">
91org.apache.solr.util</FONT>
92<BR>
93Class LongPriorityQueue</H2>
94<PRE>
95<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
96  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.solr.util.LongPriorityQueue</B>
97</PRE>
98<HR>
99<DL>
100<DT><PRE>public class <B>LongPriorityQueue</B><DT>extends <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></DL>
101</PRE>
102
103<P>
104A native long priority queue.
105<P>
106
107<P>
108<DL>
109<DT><B>NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.</B></DT>
110  <DD></DD>
111</DL>
112<HR>
113
114<P>
115<!-- =========== FIELD SUMMARY =========== -->
116
117<A NAME="field_summary"><!-- --></A>
118<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
119<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
120<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
121<B>Field Summary</B></FONT></TH>
122</TR>
123<TR BGCOLOR="white" CLASS="TableRowColor">
124<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
125<CODE>protected &nbsp;int</CODE></FONT></TD>
126<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#currentCapacity">currentCapacity</A></B></CODE>
127
128<BR>
129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
130</TR>
131<TR BGCOLOR="white" CLASS="TableRowColor">
132<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
133<CODE>protected &nbsp;long[]</CODE></FONT></TD>
134<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#heap">heap</A></B></CODE>
135
136<BR>
137&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
138</TR>
139<TR BGCOLOR="white" CLASS="TableRowColor">
140<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
141<CODE>protected &nbsp;int</CODE></FONT></TD>
142<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#maxSize">maxSize</A></B></CODE>
143
144<BR>
145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
146</TR>
147<TR BGCOLOR="white" CLASS="TableRowColor">
148<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
149<CODE>protected &nbsp;long</CODE></FONT></TD>
150<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#sentinel">sentinel</A></B></CODE>
151
152<BR>
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
154</TR>
155<TR BGCOLOR="white" CLASS="TableRowColor">
156<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
157<CODE>protected &nbsp;int</CODE></FONT></TD>
158<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#size">size</A></B></CODE>
159
160<BR>
161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
162</TR>
163</TABLE>
164&nbsp;
165<!-- ======== CONSTRUCTOR SUMMARY ======== -->
166
167<A NAME="constructor_summary"><!-- --></A>
168<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
169<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
170<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
171<B>Constructor Summary</B></FONT></TH>
172</TR>
173<TR BGCOLOR="white" CLASS="TableRowColor">
174<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#LongPriorityQueue(int, int, long)">LongPriorityQueue</A></B>(int&nbsp;initialSize,
175                  int&nbsp;maxSize,
176                  long&nbsp;sentinel)</CODE>
177
178<BR>
179&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
180</TR>
181</TABLE>
182&nbsp;
183<!-- ========== METHOD SUMMARY =========== -->
184
185<A NAME="method_summary"><!-- --></A>
186<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
187<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
188<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
189<B>Method Summary</B></FONT></TH>
190</TR>
191<TR BGCOLOR="white" CLASS="TableRowColor">
192<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
193<CODE>&nbsp;long</CODE></FONT></TD>
194<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#add(long)">add</A></B>(long&nbsp;element)</CODE>
195
196<BR>
197&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an object to a PriorityQueue in log(size) time.</TD>
198</TR>
199<TR BGCOLOR="white" CLASS="TableRowColor">
200<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
201<CODE>&nbsp;void</CODE></FONT></TD>
202<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#addNoCheck(long)">addNoCheck</A></B>(long&nbsp;element)</CODE>
203
204<BR>
205&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an object to a PriorityQueue in log(size) time.</TD>
206</TR>
207<TR BGCOLOR="white" CLASS="TableRowColor">
208<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
209<CODE>&nbsp;void</CODE></FONT></TD>
210<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#clear()">clear</A></B>()</CODE>
211
212<BR>
213&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes all entries from the PriorityQueue.</TD>
214</TR>
215<TR BGCOLOR="white" CLASS="TableRowColor">
216<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
217<CODE>&nbsp;int</CODE></FONT></TD>
218<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#getCurrentCapacity()">getCurrentCapacity</A></B>()</CODE>
219
220<BR>
221&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
222</TR>
223<TR BGCOLOR="white" CLASS="TableRowColor">
224<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
225<CODE>&nbsp;long[]</CODE></FONT></TD>
226<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#getInternalArray()">getInternalArray</A></B>()</CODE>
227
228<BR>
229&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the array used to hold the heap, with the smallest item at array[1]
230  and the last (but not necessarily largest) at array[size()].</TD>
231</TR>
232<TR BGCOLOR="white" CLASS="TableRowColor">
233<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
234<CODE>protected &nbsp;void</CODE></FONT></TD>
235<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#initialize(int)">initialize</A></B>(int&nbsp;sz)</CODE>
236
237<BR>
238&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
239</TR>
240<TR BGCOLOR="white" CLASS="TableRowColor">
241<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
242<CODE>&nbsp;boolean</CODE></FONT></TD>
243<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#insert(long)">insert</A></B>(long&nbsp;element)</CODE>
244
245<BR>
246&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;inserts the element and returns true if this element caused another element
247 to be dropped from the queue.</TD>
248</TR>
249<TR BGCOLOR="white" CLASS="TableRowColor">
250<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
251<CODE>&nbsp;long</CODE></FONT></TD>
252<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#insertWithOverflow(long)">insertWithOverflow</A></B>(long&nbsp;element)</CODE>
253
254<BR>
255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds an object to a PriorityQueue in log(size) time.</TD>
256</TR>
257<TR BGCOLOR="white" CLASS="TableRowColor">
258<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
259<CODE>&nbsp;long</CODE></FONT></TD>
260<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#pop()">pop</A></B>()</CODE>
261
262<BR>
263&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Removes and returns the least element of the PriorityQueue in log(size)
264    time.</TD>
265</TR>
266<TR BGCOLOR="white" CLASS="TableRowColor">
267<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
268<CODE>&nbsp;void</CODE></FONT></TD>
269<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#resize(int)">resize</A></B>(int&nbsp;sz)</CODE>
270
271<BR>
272&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
273</TR>
274<TR BGCOLOR="white" CLASS="TableRowColor">
275<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
276<CODE>&nbsp;int</CODE></FONT></TD>
277<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#size()">size</A></B>()</CODE>
278
279<BR>
280&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the number of elements currently stored in the PriorityQueue.</TD>
281</TR>
282<TR BGCOLOR="white" CLASS="TableRowColor">
283<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
284<CODE>&nbsp;long[]</CODE></FONT></TD>
285<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#sort(int)">sort</A></B>(int&nbsp;n)</CODE>
286
287<BR>
288&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Pops the smallest n items from the heap, placing them in the internal array at
289  arr[size] through arr[size-(n-1)] with the smallest (first element popped)
290  being at arr[size].</TD>
291</TR>
292<TR BGCOLOR="white" CLASS="TableRowColor">
293<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
294<CODE>&nbsp;long</CODE></FONT></TD>
295<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#top()">top</A></B>()</CODE>
296
297<BR>
298&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the least element of the PriorityQueue in constant time.</TD>
299</TR>
300<TR BGCOLOR="white" CLASS="TableRowColor">
301<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
302<CODE>&nbsp;long</CODE></FONT></TD>
303<TD><CODE><B><A HREF="../../../../org/apache/solr/util/LongPriorityQueue.html#updateTop()">updateTop</A></B>()</CODE>
304
305<BR>
306&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Should be called when the Object at top changes values.</TD>
307</TR>
308</TABLE>
309&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
310<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
311<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
312<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
313</TR>
314<TR BGCOLOR="white" CLASS="TableRowColor">
315<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
316</TR>
317</TABLE>
318&nbsp;
319<P>
320
321<!-- ============ FIELD DETAIL =========== -->
322
323<A NAME="field_detail"><!-- --></A>
324<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
325<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
326<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
327<B>Field Detail</B></FONT></TH>
328</TR>
329</TABLE>
330
331<A NAME="size"><!-- --></A><H3>
332size</H3>
333<PRE>
334protected int <B>size</B></PRE>
335<DL>
336<DL>
337</DL>
338</DL>
339<HR>
340
341<A NAME="currentCapacity"><!-- --></A><H3>
342currentCapacity</H3>
343<PRE>
344protected int <B>currentCapacity</B></PRE>
345<DL>
346<DL>
347</DL>
348</DL>
349<HR>
350
351<A NAME="maxSize"><!-- --></A><H3>
352maxSize</H3>
353<PRE>
354protected int <B>maxSize</B></PRE>
355<DL>
356<DL>
357</DL>
358</DL>
359<HR>
360
361<A NAME="heap"><!-- --></A><H3>
362heap</H3>
363<PRE>
364protected long[] <B>heap</B></PRE>
365<DL>
366<DL>
367</DL>
368</DL>
369<HR>
370
371<A NAME="sentinel"><!-- --></A><H3>
372sentinel</H3>
373<PRE>
374protected final long <B>sentinel</B></PRE>
375<DL>
376<DL>
377</DL>
378</DL>
379
380<!-- ========= CONSTRUCTOR DETAIL ======== -->
381
382<A NAME="constructor_detail"><!-- --></A>
383<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
384<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
385<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
386<B>Constructor Detail</B></FONT></TH>
387</TR>
388</TABLE>
389
390<A NAME="LongPriorityQueue(int, int, long)"><!-- --></A><H3>
391LongPriorityQueue</H3>
392<PRE>
393public <B>LongPriorityQueue</B>(int&nbsp;initialSize,
394                         int&nbsp;maxSize,
395                         long&nbsp;sentinel)</PRE>
396<DL>
397</DL>
398
399<!-- ============ METHOD DETAIL ========== -->
400
401<A NAME="method_detail"><!-- --></A>
402<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
403<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
404<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
405<B>Method Detail</B></FONT></TH>
406</TR>
407</TABLE>
408
409<A NAME="initialize(int)"><!-- --></A><H3>
410initialize</H3>
411<PRE>
412protected void <B>initialize</B>(int&nbsp;sz)</PRE>
413<DL>
414<DD><DL>
415</DL>
416</DD>
417</DL>
418<HR>
419
420<A NAME="getCurrentCapacity()"><!-- --></A><H3>
421getCurrentCapacity</H3>
422<PRE>
423public int <B>getCurrentCapacity</B>()</PRE>
424<DL>
425<DD><DL>
426</DL>
427</DD>
428</DL>
429<HR>
430
431<A NAME="resize(int)"><!-- --></A><H3>
432resize</H3>
433<PRE>
434public void <B>resize</B>(int&nbsp;sz)</PRE>
435<DL>
436<DD><DL>
437</DL>
438</DD>
439</DL>
440<HR>
441
442<A NAME="add(long)"><!-- --></A><H3>
443add</H3>
444<PRE>
445public long <B>add</B>(long&nbsp;element)</PRE>
446<DL>
447<DD>Adds an object to a PriorityQueue in log(size) time. If one tries to add
448 more objects than maxSize from initialize an
449 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ArrayIndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang"><CODE>ArrayIndexOutOfBoundsException</CODE></A> is thrown.
450<P>
451<DD><DL>
452
453<DT><B>Returns:</B><DD>the new 'top' element in the queue.</DL>
454</DD>
455</DL>
456<HR>
457
458<A NAME="addNoCheck(long)"><!-- --></A><H3>
459addNoCheck</H3>
460<PRE>
461public void <B>addNoCheck</B>(long&nbsp;element)</PRE>
462<DL>
463<DD>Adds an object to a PriorityQueue in log(size) time. If one tries to add
464 more objects than the current capacity, an
465 <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/ArrayIndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang"><CODE>ArrayIndexOutOfBoundsException</CODE></A> is thrown.
466<P>
467<DD><DL>
468</DL>
469</DD>
470</DL>
471<HR>
472
473<A NAME="insertWithOverflow(long)"><!-- --></A><H3>
474insertWithOverflow</H3>
475<PRE>
476public long <B>insertWithOverflow</B>(long&nbsp;element)</PRE>
477<DL>
478<DD>Adds an object to a PriorityQueue in log(size) time.
479 It returns the smallest object (if any) that was
480 dropped off the heap because it was full, or
481 the sentinel value.
482
483  This can be
484 the given parameter (in case it is smaller than the
485 full heap's minimum, and couldn't be added), or another
486 object that was previously the smallest value in the
487 heap and now has been replaced by a larger one, or null
488 if the queue wasn't yet full with maxSize elements.
489<P>
490<DD><DL>
491</DL>
492</DD>
493</DL>
494<HR>
495
496<A NAME="insert(long)"><!-- --></A><H3>
497insert</H3>
498<PRE>
499public boolean <B>insert</B>(long&nbsp;element)</PRE>
500<DL>
501<DD>inserts the element and returns true if this element caused another element
502 to be dropped from the queue.
503<P>
504<DD><DL>
505</DL>
506</DD>
507</DL>
508<HR>
509
510<A NAME="top()"><!-- --></A><H3>
511top</H3>
512<PRE>
513public long <B>top</B>()</PRE>
514<DL>
515<DD>Returns the least element of the PriorityQueue in constant time.
516<P>
517<DD><DL>
518</DL>
519</DD>
520</DL>
521<HR>
522
523<A NAME="pop()"><!-- --></A><H3>
524pop</H3>
525<PRE>
526public long <B>pop</B>()</PRE>
527<DL>
528<DD>Removes and returns the least element of the PriorityQueue in log(size)
529    time.  Only valid if size() > 0.
530<P>
531<DD><DL>
532</DL>
533</DD>
534</DL>
535<HR>
536
537<A NAME="updateTop()"><!-- --></A><H3>
538updateTop</H3>
539<PRE>
540public long <B>updateTop</B>()</PRE>
541<DL>
542<DD>Should be called when the Object at top changes values.
543<P>
544<DD><DL>
545
546<DT><B>Returns:</B><DD>the new 'top' element.</DL>
547</DD>
548</DL>
549<HR>
550
551<A NAME="size()"><!-- --></A><H3>
552size</H3>
553<PRE>
554public int <B>size</B>()</PRE>
555<DL>
556<DD>Returns the number of elements currently stored in the PriorityQueue.
557<P>
558<DD><DL>
559</DL>
560</DD>
561</DL>
562<HR>
563
564<A NAME="getInternalArray()"><!-- --></A><H3>
565getInternalArray</H3>
566<PRE>
567public long[] <B>getInternalArray</B>()</PRE>
568<DL>
569<DD>Returns the array used to hold the heap, with the smallest item at array[1]
570  and the last (but not necessarily largest) at array[size()].  This is *not*
571  fully sorted.
572<P>
573<DD><DL>
574</DL>
575</DD>
576</DL>
577<HR>
578
579<A NAME="sort(int)"><!-- --></A><H3>
580sort</H3>
581<PRE>
582public long[] <B>sort</B>(int&nbsp;n)</PRE>
583<DL>
584<DD>Pops the smallest n items from the heap, placing them in the internal array at
585  arr[size] through arr[size-(n-1)] with the smallest (first element popped)
586  being at arr[size].  The internal array is returned.
587<P>
588<DD><DL>
589</DL>
590</DD>
591</DL>
592<HR>
593
594<A NAME="clear()"><!-- --></A><H3>
595clear</H3>
596<PRE>
597public void <B>clear</B>()</PRE>
598<DL>
599<DD>Removes all entries from the PriorityQueue.
600<P>
601<DD><DL>
602</DL>
603</DD>
604</DL>
605<!-- ========= END OF CLASS DATA ========= -->
606<HR>
607
608
609<!-- ======= START OF BOTTOM NAVBAR ====== -->
610<A NAME="navbar_bottom"><!-- --></A>
611<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
612<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
613<TR>
614<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
615<A NAME="navbar_bottom_firstrow"><!-- --></A>
616<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
617  <TR ALIGN="center" VALIGN="top">
618  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
619  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
620  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
621  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/LongPriorityQueue.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
622  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
623  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
624  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
625  </TR>
626</TABLE>
627</TD>
628<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
629</EM>
630</TD>
631</TR>
632
633<TR>
634<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
635&nbsp;<A HREF="../../../../org/apache/solr/util/FileUtils.html" title="class in org.apache.solr.util"><B>PREV CLASS</B></A>&nbsp;
636&nbsp;<A HREF="../../../../org/apache/solr/util/NumberUtils.html" title="class in org.apache.solr.util"><B>NEXT CLASS</B></A></FONT></TD>
637<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
638  <A HREF="../../../../index.html?org/apache/solr/util/LongPriorityQueue.html" target="_top"><B>FRAMES</B></A>  &nbsp;
639&nbsp;<A HREF="LongPriorityQueue.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
640&nbsp;<SCRIPT type="text/javascript">
641  <!--
642  if(window==top) {
643    document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
644  }
645  //-->
646</SCRIPT>
647<NOSCRIPT>
648  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
649</NOSCRIPT>
650
651
652</FONT></TD>
653</TR>
654<TR>
655<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
656  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
657<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
658DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
659</TR>
660</TABLE>
661<A NAME="skip-navbar_bottom"></A>
662<!-- ======== END OF BOTTOM NAVBAR ======= -->
663
664<HR>
665
666          <address>Copyright &copy; 2000-2012 Apache Software Foundation.  All Rights Reserved.</address>
667          <script src='../../../../prettify.js' type='text/javascript'></script>
668          <script type='text/javascript'>
669            (function(){
670              var oldonload = window.onload;
671              if (typeof oldonload != 'function') {
672                window.onload = prettyPrint;
673              } else {
674                window.onload = function() {
675                  oldonload();
676                  prettyPrint();
677                }
678              }
679            })();
680          </script>
681       
682</BODY>
683</HTML>
Note: See TracBrowser for help on using the repository browser.