/Users/lyon/j4p/src/classUtils/pack/util/tp/Queue.java

1    package classUtils.pack.util.tp; 
2     
3    /** 
4     * A simple queue interface for Runnable objects. 
5     * <p> 
6     * This queue may decide the order with which a certain Runnable object 
7     * may be selected by implementing appropriately the {@link Queue#get() get()} method. 
8     * 
9     * @author C. Sadun 
10    * @version 1.0 
11    */ 
12   public interface Queue { 
13    
14       /** 
15        * Add a runnable object to the queue 
16        * @param obj the runnable to be added to the queue 
17        */ 
18       public void put(Runnable obj); 
19    
20       /** 
21        * Fetch a runnable object from the queue 
22        * @param obj the runnable to be fetched from o the queue 
23        */ 
24       public Runnable get(); 
25    
26       /** 
27        * Return the current size of the queue 
28        * @return the current size of the queue 
29        */ 
30       public int size(); 
31    
32       /** 
33        * Return <b>true</b> if the queue is empty 
34        * @return <b>true</b> if the queue is empty 
35        */ 
36       public boolean isEmpty(); 
37    
38   }