-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueue.java
More file actions
43 lines (37 loc) · 1.13 KB
/
Copy pathQueue.java
File metadata and controls
43 lines (37 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package edu.cofc.cs.csci230;
import java.util.NoSuchElementException;
/**
* First In First Out (FIFO) Queue
*
* Queue interface that "closely" resembles the Queue interface
* defined in the java.util package, see link below.
*
* http://docs.oracle.com/javase/7/docs/api/java/util/Queue.html
*
* @author CSCI 230: Data Structures and Algorithms Fall 2016
*
* @param <AnyType>
*/
public interface Queue<AnyType> {
/**
* Inserts the specified element at the end the queue.
*
* @param t element to add
* @throws NullPointerException- if the specified element is null (queue does not permit null elements)
*/
public void add( AnyType t ) throws NullPointerException;
/**
* Retrieves and removes the head of the queue.
*
* @return the head of the queue
* @throws NoSuchElementException - if this queue is empty
*/
public AnyType remove() throws NoSuchElementException;
/**
* Retrieves, but does not remove, the head of the queue, or
* returns null if the queue is empty.
*
* @return the head of this queue, or null if the queue is empty
*/
public AnyType peek();
} // end Queue interface description