T
- any type is possiblepublic class Queue<T>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private T[] |
array |
private int |
head |
private int |
queueLength |
private int |
tail |
Constructor and Description |
---|
Queue(int queueLength)
constructor for Queue class
|
Modifier and Type | Method and Description |
---|---|
T |
dequeue()
deletes an element from the start of the queue.
|
void |
enqueue(T newElement)
adds an element to the end of the queue
|
T[] |
getData() |
int |
getQueueLength() |
boolean |
isQueueEmpty() |
boolean |
isQueueFull() |
private final T[] array
private int queueLength
private int tail
private int head
public Queue(int queueLength)
queueLength
- the length of the queue that you want to makepublic T[] getData()
public int getQueueLength()
public void enqueue(T newElement)
newElement
- the new element to add to the queuepublic T dequeue()
public boolean isQueueEmpty()
public boolean isQueueFull()