Code example for PriorityQueue

Methods: poll

0
	public void putMessage(Message msg, MessagePriority priority){
		queue.add(new ExtendedMessage(msg, priority));
	} 
	 
	public Message pollMessage(){
		return queue.poll().getMessage();
	} 
	 
	public int getSize(){ 
		return queue.size();
	} 
}