-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueueInterface.java
More file actions
28 lines (20 loc) · 893 Bytes
/
QueueInterface.java
File metadata and controls
28 lines (20 loc) · 893 Bytes
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
public interface QueueInterface<T>
{
/** Adds a new entry to the back of this queue.
@param newEntry An object to be added. */
public void enqueue(T newEntry,int loc);
/** Removes and returns the entry at the front of this queue.
@return The object at the front of the queue.
@throws EmptyQueueException if the queue is empty before the operation. */
public T dequeue();
/** Retrieves the entry at the front of this queue.
@return The object at the front of the queue.
@throws EmptyQueueException if the queue is empty. */
public T getFront();
/** Detects whether this queue is empty.
@return True if the queue is empty, or false otherwise. */
public boolean isEmpty();
public void print();
/** Removes all entries from this queue. */
public void clear();
} // end QueueInterface