View Javadoc

1   package fr.ove.utils;
2   
3   import java.util.*;
4   
5   /***
6   * Interface to respect to have a queue behaviour
7   *
8   * @author © 2000 DIRAT Laurent
9   * @version 1.0 28/06/2000
10  */
11  
12  public interface Queueable {
13      /***
14      * Adds the specified element to the queue
15      */
16      public void enqueue(Object element); 
17  
18      /***
19      * Removes the first element added into the queue.
20      * Returns the element removed. <CODE>null</CODE> if the queue is empty
21      */
22      public Object dequeue();
23  
24      /***
25      * Returns the first element added into the queue.
26      * <CODE>null</CODE> if the queue is empty
27      */
28      public Object peek();
29  
30      /***
31      * Checks if the queue is empty.
32      * Returns <CODE>true</CODE> if the queue is empty. <CODE>false</CODE> otherwise.
33      */
34      public boolean isEmpty();
35      
36      /***
37      * Clears the queue
38      */
39      public void clear();
40      
41      /***
42      * Returns an @see Enumeration of the elements in the queue.
43      */
44      public Enumeration elements();
45  }