|
CubeTwister 2.0alpha141 2011-10-13 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
ch.randelshofer.util.PriorityQueue
public class PriorityQueue
JDCTechTips 2002-08-22. John Zukowski.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
PriorityQueue()
Constructs an empty priority queue which supports the priorities 0 to 9 (10 distinct priorities). |
|
PriorityQueue(java.util.Collection col)
Constructs a priority queue containing the elements of the specified collection, in the order they are returned by the collection'siterator. |
|
PriorityQueue(java.util.Collection col,
int count)
Constructs a priority queue containing the elements of the specified collection, in the order they are returned by the collection'siterator. |
|
PriorityQueue(int count)
Constructs an empty priority queue which supports the specified count of priorities. |
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object element)
Inserts an element to the priority queue using priority 0 (the lowest priority). |
void |
clear()
Removes all of the elements from this priority queue. |
java.lang.Object |
get(int index)
Returns the element at the specified position in this priority queue. |
java.lang.Object |
getFirst()
Returns the first element in this priority queue. |
int |
getPriorityCount()
Returns the priority count. |
void |
insert(java.lang.Object element,
int priority)
Inserts an element to the priority queue using the specified priority. |
java.util.Iterator |
iterator()
Returns an iterator of the elements in this priority queue (elements with higher priorities first). |
java.lang.Object |
removeFirst()
Returns the first element in this priority queue and returns it. |
int |
size()
Returns the number of elements in this priority queue. |
java.lang.String |
toString()
Returns a string representation of this collection. |
| Methods inherited from class java.util.AbstractList |
|---|
add, addAll, equals, hashCode, indexOf, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public PriorityQueue()
public PriorityQueue(java.util.Collection col)
public PriorityQueue(int count)
public PriorityQueue(java.util.Collection col,
int count)
count distinct priorities.
All elements are added using priority 0 (the lowest priority).
java.lang.IllegalArgumentException - if the specified priority count
is is out of range count < 0.| Method Detail |
|---|
public boolean add(java.lang.Object element)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.AbstractListpublic int getPriorityCount()
public void insert(java.lang.Object element,
int priority)
java.lang.IllegalArgumentException - if the specified priority
is is out of range (priority < 0 || priority >= getPriorityCount()).public java.lang.Object getFirst()
public java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.AbstractListjava.lang.IndexOutOfBoundsException - if the specified index
is is out of range (index < 0 || index >= size()).public void clear()
clear in interface java.util.Collectionclear in interface java.util.Listclear in class java.util.AbstractListpublic java.lang.Object removeFirst()
public int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollectionpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in class java.util.AbstractListpublic java.lang.String toString()
toString in class java.util.AbstractCollection
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||