File tree 1 file changed +31
-13
lines changed
1 file changed +31
-13
lines changed Original file line number Diff line number Diff line change 7
7
* Interface to provide queue specific functionality to the implementing class
8
8
* This interface only defines the functionality which the queue implementing classes require.
9
9
* Any class having queue behaviour should implement this interface and override all of its methods
10
+ *
10
11
* @param <T>
11
12
*/
12
13
public interface Queue <T > extends DataStructure <T > {
13
14
14
- //Method to add element
15
- public boolean offer (T t ) throws NullPointerException ;
16
-
17
- //Method to remove element
18
- public T poll ();
19
-
20
- //Method to check element on head
21
- public T peek ();
22
-
23
- //Method to check element on head. This throws exception on runtime if the queue is empty
24
- public T element () throws NoSuchElementException ;
25
-
26
-
15
+ /**
16
+ * Method to add element
17
+ *
18
+ * @param t element
19
+ * @return boolean
20
+ * @throws NullPointerException
21
+ */
22
+ boolean offer (T t ) throws NullPointerException ;
23
+
24
+ /**
25
+ * Method to remove element
26
+ *
27
+ * @return element
28
+ */
29
+ T poll ();
30
+
31
+ /**
32
+ * Method to check element on head
33
+ *
34
+ * @return element
35
+ */
36
+ T peek ();
37
+
38
+ /**
39
+ * Method to check element on head. This throws exception on runtime if the queue is empty
40
+ *
41
+ * @return element
42
+ * @throws NoSuchElementException
43
+ */
44
+ T element () throws NoSuchElementException ;
27
45
}
You can’t perform that action at this time.
0 commit comments