001 package cnslab.cnsnetwork; 002 003 import java.io.*; 004 005 /*********************************************************************** 006 * Priority Queue Structure used in both input and output queue of the 007 * simulation. 008 * Each element in the Queue is order by time. 009 * 010 * @version 011 * $Date: 2012-08-04 13:43:22 -0500 (Sat, 04 Aug 2012) $ 012 * $Rev: 104 $ 013 * $Author: croft $ 014 * @author 015 * Yi Dong 016 * @author 017 * David Wallace Croft 018 ***********************************************************************/ 019 public interface Queue<T extends Comparable<T>> 020 //////////////////////////////////////////////////////////////////////// 021 //////////////////////////////////////////////////////////////////////// 022 { 023 024 /*********************************************************************** 025 * Insert one item into the Queue 026 ***********************************************************************/ 027 void insertItem ( T item ); 028 029 /*********************************************************************** 030 * Delete one item from the queue. 031 ***********************************************************************/ 032 void deleteItem ( T item ); 033 034 /*********************************************************************** 035 * @return 036 * the highest priority item 037 ***********************************************************************/ 038 T firstItem ( ); 039 040 /*********************************************************************** 041 * Print out the queue element to the PrintStream p 042 ***********************************************************************/ 043 void show ( PrintStream p ); 044 045 /*********************************************************************** 046 * Print out the queue element to the standard output 047 ***********************************************************************/ 048 String show ( ); 049 050 /*********************************************************************** 051 * clear the queue items. 052 ***********************************************************************/ 053 void clear ( ); 054 055 //////////////////////////////////////////////////////////////////////// 056 //////////////////////////////////////////////////////////////////////// 057 }