Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit481be62

Browse files
authored
Update Queue.java
1 parent965c288 commit481be62

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

‎src/main/java/com/types/Queue.java

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,39 @@
77
* Interface to provide queue specific functionality to the implementing class
88
* This interface only defines the functionality which the queue implementing classes require.
99
* Any class having queue behaviour should implement this interface and override all of its methods
10+
*
1011
* @param <T>
1112
*/
1213
publicinterfaceQueue<T>extendsDataStructure<T> {
1314

14-
//Method to add element
15-
publicbooleanoffer(Tt)throwsNullPointerException;
16-
17-
//Method to remove element
18-
publicTpoll();
19-
20-
//Method to check element on head
21-
publicTpeek();
22-
23-
//Method to check element on head. This throws exception on runtime if the queue is empty
24-
publicTelement()throwsNoSuchElementException;
25-
26-
15+
/**
16+
* Method to add element
17+
*
18+
* @param t element
19+
* @return boolean
20+
* @throws NullPointerException
21+
*/
22+
booleanoffer(Tt)throwsNullPointerException;
23+
24+
/**
25+
* Method to remove element
26+
*
27+
* @return element
28+
*/
29+
Tpoll();
30+
31+
/**
32+
* Method to check element on head
33+
*
34+
* @return element
35+
*/
36+
Tpeek();
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+
Telement()throwsNoSuchElementException;
2745
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp