1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
5 <!-- Generated by javadoc (build 1.5.0_07) on Fri Apr 11 15:39:16 BST 2008 -->
6 <META http-equiv=
"Content-Type" content=
"text/html; charset=ISO-8859-1">
8 BinaryHeap (Commons Collections
3.2.1 API)
11 <META NAME=
"keywords" CONTENT=
"org.apache.commons.collections.BinaryHeap class">
13 <LINK REL =
"stylesheet" TYPE=
"text/css" HREF=
"../../../../stylesheet.css" TITLE=
"Style">
15 <SCRIPT type=
"text/javascript">
16 function windowTitle()
18 parent.document.
title=
"BinaryHeap (Commons Collections 3.2.1 API)";
26 <BODY BGCOLOR=
"white" onload=
"windowTitle();">
29 <!-- ========= START OF TOP NAVBAR ======= -->
30 <A NAME=
"navbar_top"><!-- --></A>
31 <A HREF=
"#skip-navbar_top" title=
"Skip navigation links"></A>
32 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
34 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
35 <A NAME=
"navbar_top_firstrow"><!-- --></A>
36 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
37 <TR ALIGN=
"center" VALIGN=
"top">
38 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
39 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
40 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
41 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/BinaryHeap.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
42 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
43 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
44 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
45 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
49 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
55 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
56 <A HREF=
"../../../../org/apache/commons/collections/BidiMap.html" title=
"interface in org.apache.commons.collections"><B>PREV CLASS
</B></A>
57 <A HREF=
"../../../../org/apache/commons/collections/BoundedCollection.html" title=
"interface in org.apache.commons.collections"><B>NEXT CLASS
</B></A></FONT></TD>
58 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
59 <A HREF=
"../../../../index.html?org/apache/commons/collections/BinaryHeap.html" target=
"_top"><B>FRAMES
</B></A>
60 <A HREF=
"BinaryHeap.html" target=
"_top"><B>NO FRAMES
</B></A>
61 <SCRIPT type=
"text/javascript">
64 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
69 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
76 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
77 SUMMARY:
NESTED
|
FIELD
|
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
78 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
79 DETAIL:
FIELD
|
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
82 <A NAME=
"skip-navbar_top"></A>
83 <!-- ========= END OF TOP NAVBAR ========= -->
86 <!-- ======== START OF CLASS DATA ======== -->
89 org.apache.commons.collections
</FONT>
94 <IMG SRC=
"../../../../resources/inherit.gif" ALT=
"extended by ">java.util.AbstractCollection
95 <IMG SRC=
"../../../../resources/inherit.gif" ALT=
"extended by "><B>org.apache.commons.collections.BinaryHeap
</B>
98 <DT><B>All Implemented Interfaces:
</B> <DD>java.lang.Iterable, java.util.Collection,
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A>,
<A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html" title=
"interface in org.apache.commons.collections">PriorityQueue
</A></DD>
101 <B>Deprecated.
</B> <I>Replaced by PriorityBuffer in buffer subpackage.
102 Due to be removed in v4.0.
</I>
105 <DT><PRE>public final class
<B>BinaryHeap
</B><DT>extends java.util.AbstractCollection
<DT>implements
<A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html" title=
"interface in org.apache.commons.collections">PriorityQueue
</A>,
<A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></DL>
109 Binary heap implementation of
<code>PriorityQueue
</code>.
111 The
<code>PriorityQueue
</code> interface has now been replaced for most uses
112 by the
<code>Buffer
</code> interface. This class and the interface are
113 retained for backwards compatibility. The intended replacement is
114 <A HREF=
"../../../../org/apache/commons/collections/buffer/PriorityBuffer.html" title=
"class in org.apache.commons.collections.buffer"><CODE>PriorityBuffer
</CODE></A>.
116 The removal order of a binary heap is based on either the natural sort
117 order of its elements or a specified
<CODE>Comparator
</CODE>. The
118 <A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#pop()"><CODE>pop()
</CODE></A> method always returns the first element as determined
119 by the sort order. (The
<code>isMinHeap
</code> flag in the constructors
120 can be used to reverse the sort order, in which case
<A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#pop()"><CODE>pop()
</CODE></A>
121 will always remove the last element.) The removal order is
122 <i>not
</i> the same as the order of iteration; elements are
123 returned by the iterator in no particular order.
125 The
<A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#insert(java.lang.Object)"><CODE>insert(Object)
</CODE></A> and
<A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#pop()"><CODE>pop()
</CODE></A> operations perform
126 in logarithmic time. The
<A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#peek()"><CODE>peek()
</CODE></A> operation performs in constant
127 time. All other operations perform in linear time or worse.
129 Note that this implementation is not synchronized. Use SynchronizedPriorityQueue
130 to provide synchronized access to a
<code>BinaryHeap
</code>:
133 PriorityQueue heap = new SynchronizedPriorityQueue(new BinaryHeap());
139 <DT><B>Since:
</B></DT>
140 <DD>Commons Collections
1.0</DD>
141 <DT><B>Version:
</B></DT>
142 <DD>$Revision:
646777 $ $Date:
2008-
04-
10 13:
33:
15 +
0100 (Thu,
10 Apr
2008) $
</DD>
143 <DT><B>Author:
</B></DT>
144 <DD>Peter Donald, Ram Chidambaram, Michael A. Smith, Paul Jack, Stephen Colebourne
</DD>
150 <!-- ======== CONSTRUCTOR SUMMARY ======== -->
152 <A NAME=
"constructor_summary"><!-- --></A>
153 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
154 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
155 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
156 <B>Constructor Summary
</B></FONT></TH>
158 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
159 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap()">BinaryHeap
</A></B>()
</CODE>
162 <B>Deprecated.
</B> Constructs a new minimum binary heap.
</TD>
164 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
165 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap(boolean)">BinaryHeap
</A></B>(boolean
isMinHeap)
</CODE>
168 <B>Deprecated.
</B> Constructs a new minimum or maximum binary heap
</TD>
170 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
171 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap(boolean, java.util.Comparator)">BinaryHeap
</A></B>(boolean
isMinHeap,
172 java.util.Comparator
comparator)
</CODE>
175 <B>Deprecated.
</B> Constructs a new
<code>BinaryHeap
</code>.
</TD>
177 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
178 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap(java.util.Comparator)">BinaryHeap
</A></B>(java.util.Comparator
comparator)
</CODE>
181 <B>Deprecated.
</B> Constructs a new
<code>BinaryHeap
</code> that will use the given
182 comparator to order its elements.
</TD>
184 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
185 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap(int)">BinaryHeap
</A></B>(int
capacity)
</CODE>
188 <B>Deprecated.
</B> Constructs a new minimum binary heap with the specified initial capacity.
</TD>
190 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
191 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap(int, boolean)">BinaryHeap
</A></B>(int
capacity,
192 boolean
isMinHeap)
</CODE>
195 <B>Deprecated.
</B> Constructs a new minimum or maximum binary heap with the specified
196 initial capacity.
</TD>
198 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
199 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap(int, boolean, java.util.Comparator)">BinaryHeap
</A></B>(int
capacity,
200 boolean
isMinHeap,
201 java.util.Comparator
comparator)
</CODE>
204 <B>Deprecated.
</B> Constructs a new
<code>BinaryHeap
</code>.
</TD>
206 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
207 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#BinaryHeap(int, java.util.Comparator)">BinaryHeap
</A></B>(int
capacity,
208 java.util.Comparator
comparator)
</CODE>
211 <B>Deprecated.
</B> Constructs a new
<code>BinaryHeap
</code>.
</TD>
215 <!-- ========== METHOD SUMMARY =========== -->
217 <A NAME=
"method_summary"><!-- --></A>
218 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
219 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
220 <TH ALIGN=
"left" COLSPAN=
"2"><FONT SIZE=
"+2">
221 <B>Method Summary
</B></FONT></TH>
223 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
224 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
225 <CODE> boolean
</CODE></FONT></TD>
226 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#add(java.lang.Object)">add
</A></B>(java.lang.Object
object)
</CODE>
229 <B>Deprecated.
</B> Adds an object to this heap.
</TD>
231 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
232 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
233 <CODE> void
</CODE></FONT></TD>
234 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#clear()">clear
</A></B>()
</CODE>
237 <B>Deprecated.
</B> Clears all elements from queue.
</TD>
239 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
240 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
241 <CODE> java.lang.Object
</CODE></FONT></TD>
242 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#get()">get
</A></B>()
</CODE>
245 <B>Deprecated.
</B> Returns the priority element.
</TD>
247 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
248 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
249 <CODE>protected
void
</CODE></FONT></TD>
250 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#grow()">grow
</A></B>()
</CODE>
253 <B>Deprecated.
</B> Increases the size of the heap to support additional elements
</TD>
255 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
256 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
257 <CODE> void
</CODE></FONT></TD>
258 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#insert(java.lang.Object)">insert
</A></B>(java.lang.Object
element)
</CODE>
261 <B>Deprecated.
</B> Inserts an element into queue.
</TD>
263 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
264 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
265 <CODE> boolean
</CODE></FONT></TD>
266 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#isEmpty()">isEmpty
</A></B>()
</CODE>
269 <B>Deprecated.
</B> Tests if queue is empty.
</TD>
271 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
272 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
273 <CODE> boolean
</CODE></FONT></TD>
274 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#isFull()">isFull
</A></B>()
</CODE>
277 <B>Deprecated.
</B> Tests if queue is full.
</TD>
279 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
280 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
281 <CODE> java.util.Iterator
</CODE></FONT></TD>
282 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#iterator()">iterator
</A></B>()
</CODE>
285 <B>Deprecated.
</B> Returns an iterator over this heap's elements.
</TD>
287 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
288 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
289 <CODE> java.lang.Object
</CODE></FONT></TD>
290 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#peek()">peek
</A></B>()
</CODE>
293 <B>Deprecated.
</B> Returns the element on top of heap but don't remove it.
</TD>
295 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
296 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
297 <CODE>protected
void
</CODE></FONT></TD>
298 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#percolateDownMaxHeap(int)">percolateDownMaxHeap
</A></B>(int
index)
</CODE>
301 <B>Deprecated.
</B> Percolates element down heap from the position given by the index.
</TD>
303 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
304 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
305 <CODE>protected
void
</CODE></FONT></TD>
306 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#percolateDownMinHeap(int)">percolateDownMinHeap
</A></B>(int
index)
</CODE>
309 <B>Deprecated.
</B> Percolates element down heap from the position given by the index.
</TD>
311 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
312 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
313 <CODE>protected
void
</CODE></FONT></TD>
314 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#percolateUpMaxHeap(int)">percolateUpMaxHeap
</A></B>(int
index)
</CODE>
317 <B>Deprecated.
</B> Percolates element up heap from from the position given by the index.
</TD>
319 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
320 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
321 <CODE>protected
void
</CODE></FONT></TD>
322 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#percolateUpMaxHeap(java.lang.Object)">percolateUpMaxHeap
</A></B>(java.lang.Object
element)
</CODE>
325 <B>Deprecated.
</B> Percolates a new element up heap from the bottom.
</TD>
327 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
328 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
329 <CODE>protected
void
</CODE></FONT></TD>
330 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#percolateUpMinHeap(int)">percolateUpMinHeap
</A></B>(int
index)
</CODE>
333 <B>Deprecated.
</B> Percolates element up heap from the position given by the index.
</TD>
335 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
336 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
337 <CODE>protected
void
</CODE></FONT></TD>
338 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#percolateUpMinHeap(java.lang.Object)">percolateUpMinHeap
</A></B>(java.lang.Object
element)
</CODE>
341 <B>Deprecated.
</B> Percolates a new element up heap from the bottom.
</TD>
343 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
344 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
345 <CODE> java.lang.Object
</CODE></FONT></TD>
346 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#pop()">pop
</A></B>()
</CODE>
349 <B>Deprecated.
</B> Returns the element on top of heap and remove it.
</TD>
351 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
352 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
353 <CODE> java.lang.Object
</CODE></FONT></TD>
354 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#remove()">remove
</A></B>()
</CODE>
357 <B>Deprecated.
</B> Removes the priority element.
</TD>
359 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
360 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
361 <CODE> int
</CODE></FONT></TD>
362 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#size()">size
</A></B>()
</CODE>
365 <B>Deprecated.
</B> Returns the number of elements in this heap.
</TD>
367 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
368 <TD ALIGN=
"right" VALIGN=
"top" WIDTH=
"1%"><FONT SIZE=
"-1">
369 <CODE> java.lang.String
</CODE></FONT></TD>
370 <TD><CODE><B><A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#toString()">toString
</A></B>()
</CODE>
373 <B>Deprecated.
</B> Returns a string representation of this heap.
</TD>
376 <A NAME=
"methods_inherited_from_class_java.util.AbstractCollection"><!-- --></A>
377 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
378 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
379 <TH ALIGN=
"left"><B>Methods inherited from class java.util.AbstractCollection
</B></TH>
381 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
382 <TD><CODE>addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray
</CODE></TD>
385 <A NAME=
"methods_inherited_from_class_java.lang.Object"><!-- --></A>
386 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
387 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
388 <TH ALIGN=
"left"><B>Methods inherited from class java.lang.Object
</B></TH>
390 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
391 <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
</CODE></TD>
394 <A NAME=
"methods_inherited_from_class_java.util.Collection"><!-- --></A>
395 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
396 <TR BGCOLOR=
"#EEEEFF" CLASS=
"TableSubHeadingColor">
397 <TH ALIGN=
"left"><B>Methods inherited from interface java.util.Collection
</B></TH>
399 <TR BGCOLOR=
"white" CLASS=
"TableRowColor">
400 <TD><CODE>addAll, contains, containsAll, equals, hashCode, remove, removeAll, retainAll, toArray, toArray
</CODE></TD>
406 <!-- ========= CONSTRUCTOR DETAIL ======== -->
408 <A NAME=
"constructor_detail"><!-- --></A>
409 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
410 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
411 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
412 <B>Constructor Detail
</B></FONT></TH>
416 <A NAME=
"BinaryHeap()"><!-- --></A><H3>
419 public
<B>BinaryHeap
</B>()
</PRE>
421 <DD><B>Deprecated.
</B> <DD>Constructs a new minimum binary heap.
426 <A NAME=
"BinaryHeap(java.util.Comparator)"><!-- --></A><H3>
429 public
<B>BinaryHeap
</B>(java.util.Comparator
comparator)
</PRE>
431 <DD><B>Deprecated.
</B> <DD>Constructs a new
<code>BinaryHeap
</code> that will use the given
432 comparator to order its elements.
435 <DT><B>Parameters:
</B><DD><CODE>comparator
</CODE> - the comparator used to order the elements, null
436 means use natural order
</DL>
440 <A NAME=
"BinaryHeap(int)"><!-- --></A><H3>
443 public
<B>BinaryHeap
</B>(int
capacity)
</PRE>
445 <DD><B>Deprecated.
</B> <DD>Constructs a new minimum binary heap with the specified initial capacity.
448 <DT><B>Parameters:
</B><DD><CODE>capacity
</CODE> - The initial capacity for the heap. This value must
449 be greater than zero.
451 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if
<code>capacity
</code> is
<=
<code>0</code></DL>
455 <A NAME=
"BinaryHeap(int, java.util.Comparator)"><!-- --></A><H3>
458 public
<B>BinaryHeap
</B>(int
capacity,
459 java.util.Comparator
comparator)
</PRE>
461 <DD><B>Deprecated.
</B> <DD>Constructs a new
<code>BinaryHeap
</code>.
464 <DT><B>Parameters:
</B><DD><CODE>capacity
</CODE> - the initial capacity for the heap
<DD><CODE>comparator
</CODE> - the comparator used to order the elements, null
465 means use natural order
467 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if
<code>capacity
</code> is
<=
<code>0</code></DL>
471 <A NAME=
"BinaryHeap(boolean)"><!-- --></A><H3>
474 public
<B>BinaryHeap
</B>(boolean
isMinHeap)
</PRE>
476 <DD><B>Deprecated.
</B> <DD>Constructs a new minimum or maximum binary heap
479 <DT><B>Parameters:
</B><DD><CODE>isMinHeap
</CODE> - if
<code>true
</code> the heap is created as a
480 minimum heap; otherwise, the heap is created as a maximum heap
</DL>
484 <A NAME=
"BinaryHeap(boolean, java.util.Comparator)"><!-- --></A><H3>
487 public
<B>BinaryHeap
</B>(boolean
isMinHeap,
488 java.util.Comparator
comparator)
</PRE>
490 <DD><B>Deprecated.
</B> <DD>Constructs a new
<code>BinaryHeap
</code>.
493 <DT><B>Parameters:
</B><DD><CODE>isMinHeap
</CODE> - true to use the order imposed by the given
494 comparator; false to reverse that order
<DD><CODE>comparator
</CODE> - the comparator used to order the elements, null
495 means use natural order
</DL>
499 <A NAME=
"BinaryHeap(int, boolean)"><!-- --></A><H3>
502 public
<B>BinaryHeap
</B>(int
capacity,
503 boolean
isMinHeap)
</PRE>
505 <DD><B>Deprecated.
</B> <DD>Constructs a new minimum or maximum binary heap with the specified
509 <DT><B>Parameters:
</B><DD><CODE>capacity
</CODE> - the initial capacity for the heap. This value must
510 be greater than zero.
<DD><CODE>isMinHeap
</CODE> - if
<code>true
</code> the heap is created as a
511 minimum heap; otherwise, the heap is created as a maximum heap.
513 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if
<code>capacity
</code> is
<code><=
0</code></DL>
517 <A NAME=
"BinaryHeap(int, boolean, java.util.Comparator)"><!-- --></A><H3>
520 public
<B>BinaryHeap
</B>(int
capacity,
521 boolean
isMinHeap,
522 java.util.Comparator
comparator)
</PRE>
524 <DD><B>Deprecated.
</B> <DD>Constructs a new
<code>BinaryHeap
</code>.
527 <DT><B>Parameters:
</B><DD><CODE>capacity
</CODE> - the initial capacity for the heap
<DD><CODE>isMinHeap
</CODE> - true to use the order imposed by the given
528 comparator; false to reverse that order
<DD><CODE>comparator
</CODE> - the comparator used to order the elements, null
529 means use natural order
531 <DD><CODE>java.lang.IllegalArgumentException
</CODE> - if
<code>capacity
</code> is
<code><=
0</code></DL>
534 <!-- ============ METHOD DETAIL ========== -->
536 <A NAME=
"method_detail"><!-- --></A>
537 <TABLE BORDER=
"1" WIDTH=
"100%" CELLPADDING=
"3" CELLSPACING=
"0" SUMMARY=
"">
538 <TR BGCOLOR=
"#CCCCFF" CLASS=
"TableHeadingColor">
539 <TH ALIGN=
"left" COLSPAN=
"1"><FONT SIZE=
"+2">
540 <B>Method Detail
</B></FONT></TH>
544 <A NAME=
"clear()"><!-- --></A><H3>
547 public void
<B>clear
</B>()
</PRE>
549 <DD><B>Deprecated.
</B> <DD>Clears all elements from queue.
552 <DT><B>Specified by:
</B><DD><CODE>clear
</CODE> in interface
<CODE>java.util.Collection
</CODE><DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html#clear()">clear
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html" title=
"interface in org.apache.commons.collections">PriorityQueue
</A></CODE><DT><B>Overrides:
</B><DD><CODE>clear
</CODE> in class
<CODE>java.util.AbstractCollection
</CODE></DL>
560 <A NAME=
"isEmpty()"><!-- --></A><H3>
563 public boolean
<B>isEmpty
</B>()
</PRE>
565 <DD><B>Deprecated.
</B> <DD>Tests if queue is empty.
568 <DT><B>Specified by:
</B><DD><CODE>isEmpty
</CODE> in interface
<CODE>java.util.Collection
</CODE><DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html#isEmpty()">isEmpty
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html" title=
"interface in org.apache.commons.collections">PriorityQueue
</A></CODE><DT><B>Overrides:
</B><DD><CODE>isEmpty
</CODE> in class
<CODE>java.util.AbstractCollection
</CODE></DL>
572 <DT><B>Returns:
</B><DD><code>true
</code> if queue is empty;
<code>false
</code>
578 <A NAME=
"isFull()"><!-- --></A><H3>
581 public boolean
<B>isFull
</B>()
</PRE>
583 <DD><B>Deprecated.
</B> <DD>Tests if queue is full.
590 <DT><B>Returns:
</B><DD><code>true
</code> if queue is full;
<code>false
</code>
596 <A NAME=
"insert(java.lang.Object)"><!-- --></A><H3>
599 public void
<B>insert
</B>(java.lang.Object
element)
</PRE>
601 <DD><B>Deprecated.
</B> <DD>Inserts an element into queue.
604 <DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html#insert(java.lang.Object)">insert
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html" title=
"interface in org.apache.commons.collections">PriorityQueue
</A></CODE></DL>
607 <DT><B>Parameters:
</B><DD><CODE>element
</CODE> - the element to be inserted
</DL>
612 <A NAME=
"peek()"><!-- --></A><H3>
615 public java.lang.Object
<B>peek
</B>()
616 throws java.util.NoSuchElementException
</PRE>
618 <DD><B>Deprecated.
</B> <DD>Returns the element on top of heap but don't remove it.
621 <DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html#peek()">peek
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html" title=
"interface in org.apache.commons.collections">PriorityQueue
</A></CODE></DL>
625 <DT><B>Returns:
</B><DD>the element at top of heap
627 <DD><CODE>java.util.NoSuchElementException
</CODE> - if
<code>isEmpty() == true
</code></DL>
632 <A NAME=
"pop()"><!-- --></A><H3>
635 public java.lang.Object
<B>pop
</B>()
636 throws java.util.NoSuchElementException
</PRE>
638 <DD><B>Deprecated.
</B> <DD>Returns the element on top of heap and remove it.
641 <DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html#pop()">pop
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/PriorityQueue.html" title=
"interface in org.apache.commons.collections">PriorityQueue
</A></CODE></DL>
645 <DT><B>Returns:
</B><DD>the element at top of heap
647 <DD><CODE>java.util.NoSuchElementException
</CODE> - if
<code>isEmpty() == true
</code></DL>
652 <A NAME=
"percolateDownMinHeap(int)"><!-- --></A><H3>
653 percolateDownMinHeap
</H3>
655 protected void
<B>percolateDownMinHeap
</B>(int
index)
</PRE>
657 <DD><B>Deprecated.
</B> <DD>Percolates element down heap from the position given by the index.
659 Assumes it is a minimum heap.
665 <DT><B>Parameters:
</B><DD><CODE>index
</CODE> - the index for the element
</DL>
670 <A NAME=
"percolateDownMaxHeap(int)"><!-- --></A><H3>
671 percolateDownMaxHeap
</H3>
673 protected void
<B>percolateDownMaxHeap
</B>(int
index)
</PRE>
675 <DD><B>Deprecated.
</B> <DD>Percolates element down heap from the position given by the index.
677 Assumes it is a maximum heap.
683 <DT><B>Parameters:
</B><DD><CODE>index
</CODE> - the index of the element
</DL>
688 <A NAME=
"percolateUpMinHeap(int)"><!-- --></A><H3>
689 percolateUpMinHeap
</H3>
691 protected void
<B>percolateUpMinHeap
</B>(int
index)
</PRE>
693 <DD><B>Deprecated.
</B> <DD>Percolates element up heap from the position given by the index.
695 Assumes it is a minimum heap.
701 <DT><B>Parameters:
</B><DD><CODE>index
</CODE> - the index of the element to be percolated up
</DL>
706 <A NAME=
"percolateUpMinHeap(java.lang.Object)"><!-- --></A><H3>
707 percolateUpMinHeap
</H3>
709 protected void
<B>percolateUpMinHeap
</B>(java.lang.Object
element)
</PRE>
711 <DD><B>Deprecated.
</B> <DD>Percolates a new element up heap from the bottom.
713 Assumes it is a minimum heap.
719 <DT><B>Parameters:
</B><DD><CODE>element
</CODE> - the element
</DL>
724 <A NAME=
"percolateUpMaxHeap(int)"><!-- --></A><H3>
725 percolateUpMaxHeap
</H3>
727 protected void
<B>percolateUpMaxHeap
</B>(int
index)
</PRE>
729 <DD><B>Deprecated.
</B> <DD>Percolates element up heap from from the position given by the index.
731 Assume it is a maximum heap.
737 <DT><B>Parameters:
</B><DD><CODE>index
</CODE> - the index of the element to be percolated up
</DL>
742 <A NAME=
"percolateUpMaxHeap(java.lang.Object)"><!-- --></A><H3>
743 percolateUpMaxHeap
</H3>
745 protected void
<B>percolateUpMaxHeap
</B>(java.lang.Object
element)
</PRE>
747 <DD><B>Deprecated.
</B> <DD>Percolates a new element up heap from the bottom.
749 Assume it is a maximum heap.
755 <DT><B>Parameters:
</B><DD><CODE>element
</CODE> - the element
</DL>
760 <A NAME=
"grow()"><!-- --></A><H3>
763 protected void
<B>grow
</B>()
</PRE>
765 <DD><B>Deprecated.
</B> <DD>Increases the size of the heap to support additional elements
776 <A NAME=
"toString()"><!-- --></A><H3>
779 public java.lang.String
<B>toString
</B>()
</PRE>
781 <DD><B>Deprecated.
</B> <DD>Returns a string representation of this heap. The returned string
782 is similar to those produced by standard JDK collections.
785 <DT><B>Overrides:
</B><DD><CODE>toString
</CODE> in class
<CODE>java.util.AbstractCollection
</CODE></DL>
789 <DT><B>Returns:
</B><DD>a string representation of this heap
</DL>
794 <A NAME=
"iterator()"><!-- --></A><H3>
797 public java.util.Iterator
<B>iterator
</B>()
</PRE>
799 <DD><B>Deprecated.
</B> <DD>Returns an iterator over this heap's elements.
802 <DT><B>Specified by:
</B><DD><CODE>iterator
</CODE> in interface
<CODE>java.lang.Iterable
</CODE><DT><B>Specified by:
</B><DD><CODE>iterator
</CODE> in interface
<CODE>java.util.Collection
</CODE><DT><B>Specified by:
</B><DD><CODE>iterator
</CODE> in class
<CODE>java.util.AbstractCollection
</CODE></DL>
806 <DT><B>Returns:
</B><DD>an iterator over this heap's elements
</DL>
811 <A NAME=
"add(java.lang.Object)"><!-- --></A><H3>
814 public boolean
<B>add
</B>(java.lang.Object
object)
</PRE>
816 <DD><B>Deprecated.
</B> <DD>Adds an object to this heap. Same as
<A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#insert(java.lang.Object)"><CODE>insert(Object)
</CODE></A>.
819 <DT><B>Specified by:
</B><DD><CODE>add
</CODE> in interface
<CODE>java.util.Collection
</CODE><DT><B>Overrides:
</B><DD><CODE>add
</CODE> in class
<CODE>java.util.AbstractCollection
</CODE></DL>
822 <DT><B>Parameters:
</B><DD><CODE>object
</CODE> - the object to add
823 <DT><B>Returns:
</B><DD>true, always
</DL>
828 <A NAME=
"get()"><!-- --></A><H3>
831 public java.lang.Object
<B>get
</B>()
</PRE>
833 <DD><B>Deprecated.
</B> <DD>Returns the priority element. Same as
<A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#peek()"><CODE>peek()
</CODE></A>.
836 <DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/Buffer.html#get()">get
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></DL>
840 <DT><B>Returns:
</B><DD>the priority element
842 <DD><CODE><A HREF=
"../../../../org/apache/commons/collections/BufferUnderflowException.html" title=
"class in org.apache.commons.collections">BufferUnderflowException
</A></CODE> - if this heap is empty
</DL>
847 <A NAME=
"remove()"><!-- --></A><H3>
850 public java.lang.Object
<B>remove
</B>()
</PRE>
852 <DD><B>Deprecated.
</B> <DD>Removes the priority element. Same as
<A HREF=
"../../../../org/apache/commons/collections/BinaryHeap.html#pop()"><CODE>pop()
</CODE></A>.
855 <DT><B>Specified by:
</B><DD><CODE><A HREF=
"../../../../org/apache/commons/collections/Buffer.html#remove()">remove
</A></CODE> in interface
<CODE><A HREF=
"../../../../org/apache/commons/collections/Buffer.html" title=
"interface in org.apache.commons.collections">Buffer
</A></CODE></DL>
859 <DT><B>Returns:
</B><DD>the removed priority element
861 <DD><CODE><A HREF=
"../../../../org/apache/commons/collections/BufferUnderflowException.html" title=
"class in org.apache.commons.collections">BufferUnderflowException
</A></CODE> - if this heap is empty
</DL>
866 <A NAME=
"size()"><!-- --></A><H3>
869 public int
<B>size
</B>()
</PRE>
871 <DD><B>Deprecated.
</B> <DD>Returns the number of elements in this heap.
874 <DT><B>Specified by:
</B><DD><CODE>size
</CODE> in interface
<CODE>java.util.Collection
</CODE><DT><B>Specified by:
</B><DD><CODE>size
</CODE> in class
<CODE>java.util.AbstractCollection
</CODE></DL>
878 <DT><B>Returns:
</B><DD>the number of elements in this heap
</DL>
881 <!-- ========= END OF CLASS DATA ========= -->
885 <!-- ======= START OF BOTTOM NAVBAR ====== -->
886 <A NAME=
"navbar_bottom"><!-- --></A>
887 <A HREF=
"#skip-navbar_bottom" title=
"Skip navigation links"></A>
888 <TABLE BORDER=
"0" WIDTH=
"100%" CELLPADDING=
"1" CELLSPACING=
"0" SUMMARY=
"">
890 <TD COLSPAN=
2 BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1">
891 <A NAME=
"navbar_bottom_firstrow"><!-- --></A>
892 <TABLE BORDER=
"0" CELLPADDING=
"0" CELLSPACING=
"3" SUMMARY=
"">
893 <TR ALIGN=
"center" VALIGN=
"top">
894 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../overview-summary.html"><FONT CLASS=
"NavBarFont1"><B>Overview
</B></FONT></A> </TD>
895 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-summary.html"><FONT CLASS=
"NavBarFont1"><B>Package
</B></FONT></A> </TD>
896 <TD BGCOLOR=
"#FFFFFF" CLASS=
"NavBarCell1Rev"> <FONT CLASS=
"NavBarFont1Rev"><B>Class
</B></FONT> </TD>
897 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"class-use/BinaryHeap.html"><FONT CLASS=
"NavBarFont1"><B>Use
</B></FONT></A> </TD>
898 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"package-tree.html"><FONT CLASS=
"NavBarFont1"><B>Tree
</B></FONT></A> </TD>
899 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../deprecated-list.html"><FONT CLASS=
"NavBarFont1"><B>Deprecated
</B></FONT></A> </TD>
900 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../index-all.html"><FONT CLASS=
"NavBarFont1"><B>Index
</B></FONT></A> </TD>
901 <TD BGCOLOR=
"#EEEEFF" CLASS=
"NavBarCell1"> <A HREF=
"../../../../help-doc.html"><FONT CLASS=
"NavBarFont1"><B>Help
</B></FONT></A> </TD>
905 <TD ALIGN=
"right" VALIGN=
"top" ROWSPAN=
3><EM>
911 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
912 <A HREF=
"../../../../org/apache/commons/collections/BidiMap.html" title=
"interface in org.apache.commons.collections"><B>PREV CLASS
</B></A>
913 <A HREF=
"../../../../org/apache/commons/collections/BoundedCollection.html" title=
"interface in org.apache.commons.collections"><B>NEXT CLASS
</B></A></FONT></TD>
914 <TD BGCOLOR=
"white" CLASS=
"NavBarCell2"><FONT SIZE=
"-2">
915 <A HREF=
"../../../../index.html?org/apache/commons/collections/BinaryHeap.html" target=
"_top"><B>FRAMES
</B></A>
916 <A HREF=
"BinaryHeap.html" target=
"_top"><B>NO FRAMES
</B></A>
917 <SCRIPT type=
"text/javascript">
920 document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
925 <A HREF=
"../../../../allclasses-noframe.html"><B>All Classes
</B></A>
932 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
933 SUMMARY:
NESTED
|
FIELD
|
<A HREF=
"#constructor_summary">CONSTR
</A> |
<A HREF=
"#method_summary">METHOD
</A></FONT></TD>
934 <TD VALIGN=
"top" CLASS=
"NavBarCell3"><FONT SIZE=
"-2">
935 DETAIL:
FIELD
|
<A HREF=
"#constructor_detail">CONSTR
</A> |
<A HREF=
"#method_detail">METHOD
</A></FONT></TD>
938 <A NAME=
"skip-navbar_bottom"></A>
939 <!-- ======== END OF BOTTOM NAVBAR ======= -->
942 Copyright ©
2001-
2008 <a href=
"http://www.apache.org/">The Apache Software Foundation
</a>. All Rights Reserved.