-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueueADT.java
More file actions
53 lines (46 loc) · 1.19 KB
/
QueueADT.java
File metadata and controls
53 lines (46 loc) · 1.19 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
44
45
46
47
48
49
50
51
52
53
/**
* QueueADT defines the interface to a queue collection.
*
* @author Dr. Lewis
* @author Dr. Chase
* @version 1.0, 8/12/08
*/
public interface QueueADT<T>
{
/**
* Adds one element to the rear of this queue.
*
* @param element the element to be added to the rear of this queue
*/
public void enqueue (T element);
/**
* Removes and returns the element at the front of this queue.
*
* @return the element at the front of this queue
*/
public T dequeue();
/**
* Returns without removing the element at the front of this queue.
*
* @return the first element in this queue
*/
public T first();
/**
* Returns true if this queue contains no elements.
*
* @return true if this queue is empty
*/
public boolean isEmpty();
/**
* Returns the number of elements in this queue.
*
* @return the integer representation of the size of this queue
*/
public int size();
/**
* Returns a string representation of this queue.
*
* @return the string representation of this queue
*/
public String toString();
}