Code example for PriorityBlockingQueue

Methods: peek

0
	 * Return the execution time of the job in the nearest future. 
	 *  
	 * @return 
	 */ 
	public Long getNextExecTime() {
		TimedExecutorJob jobNext = pendingTimes.peek();
		if (jobNext != null)
			return jobNext.execTime;
		else 
			return null; 
	} 
 
	/** 
	 * Return the jobId of the job in the nearest future. 
	 *  
	 * @return 
	 */ 
	public String getNextPendingJob() {
		TimedExecutorJob jobNext = pendingTimes.peek();
		if (jobNext != null)
			return jobNext.jobId;