-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQueue.java
More file actions
47 lines (41 loc) · 1.13 KB
/
Queue.java
File metadata and controls
47 lines (41 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
44
45
46
47
package Etapa4;
/**
* Interface que define o comportamento de uma Fila.
*/
public interface Queue<E> {
/**
* Informa se a fila est‡ vazia.
* @return Verdadeiro se a fila estiver vazia, falso caso contr‡rio.
*/
public boolean isEmpty();
/**
* Informa se a fila est‡ cheia.
* @return Verdadeiro se a fila estiver cheia, falso caso contr‡rio.
*/
public boolean isFull();
/**
* Informa a quantidade de elementos armazenados na fila.
* @return A quantidade de elementos armazenados na fila.
*/
public int numElements();
/**
* Insere um novo elemento na fila.
* @param element O elemento a ser inserido
*/
public void enqueue(E element) throws OverflowException;
/**
* Retira um elemento da fila.
* @return O elemento retirado
*/
public E dequeue() throws UnderflowException;
/**
* Informa qual o primeiro elemento da fila.
* @return O primeiro elemento da fila
*/
public E front() throws UnderflowException;
/**
* Informa qual o œltimo elemento da fila.
* @return O œltimo elemento da fila
*/
public E back() throws UnderflowException;
}