Code example for PriorityQueue

Methods: add

0
	} 
	 
	/*Add a vertex to the queue, PriorityQueue automatically handles 
	adding it to the correct spot*/ 
	public void add(Vertex newV){ 
		pQueue.add(newV); 
	} 
	 
	//This removes and returns the head of the queue 
	public Vertex remove(){ 
		return pQueue.poll(); 
	} 
	 
	//Look at the first value without removing 
	public Vertex peek(){ 
		return pQueue.peek(); 
	} 
	 
	public boolean hasMore(){ 
		return !pQueue.isEmpty(); 
	}