Package dsa.lab09.base
Class PriorityQueue.ItemIterator<Priority extends Comparable<Priority>,Item> 
java.lang.Object
dsa.lab09.base.PriorityQueue.ItemIterator<Priority,Item> 
- Type Parameters:
- Priority- the item type
- Item- the item type
- All Implemented Interfaces:
- Iterator<Item>
- Enclosing interface:
- PriorityQueue<Priority extends Comparable<Priority>,- Item> 
public static class PriorityQueue.ItemIterator<Priority extends Comparable<Priority>,Item> 
extends Object
implements Iterator<Item>
An iterator over the items in a priority queue.
 
Iterates over the items of a given prioritised item iterator.
- 
Constructor SummaryConstructorsConstructorDescriptionItemIterator(Iterator<PriorityQueueItem<Priority, Item>> prioritisedItemIterator) Construct an iterator over the items in the given prioritised item iterator.
- 
Method SummaryMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.IteratorforEachRemaining
- 
Constructor Details- 
ItemIteratorConstruct an iterator over the items in the given prioritised item iterator.- Parameters:
- prioritisedItemIterator- the iterator over prioritised items
 
 
- 
- 
Method Details- 
hasNextpublic boolean hasNext()Check if there are more items to be iterated over.(Equivalently, checks if next()would return an item rather than throwing aNoSuchElementException.)
- 
nextGet the next item in the iteration.- Specified by:
- nextin interface- Iterator<Priority extends Comparable<Priority>>
- Returns:
- the next item
- Throws:
- NoSuchElementException- if there is no next item
 
- 
removeRemove the previous item returned fromnext().- Specified by:
- removein interface- Iterator<Priority extends Comparable<Priority>>
- Throws:
- IllegalStateException- if- next()hasn't yet been called, or if- remove()has already been called since- next()was last called
 
 
-