|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object structure.AbstractStructure structure.AbstractLinear structure.AbstractQueue structure.QueueArray
public class QueueArray
An implementation of a queue based on arrays.
Constructor Summary | |
---|---|
QueueArray(int size)
Construct a queue holding at most size elements. |
Method Summary | |
---|---|
void |
add(Object value)
Add a value to the tail of the queue. |
void |
clear()
Remove all the values from the queue. |
Object |
get()
Fetch the value at the head of the queue. |
boolean |
isEmpty()
Determine if the queue is empty. |
boolean |
isFull()
Determines if the queue is not able to accept any new values. |
Iterator |
iterator()
Returns an iterator for traversing the structure. |
Object |
remove()
Remove a value from the head of the queue. |
int |
size()
Determine the number of elements within the queue |
String |
toString()
Construct a string representation of the queue. |
Methods inherited from class structure.AbstractQueue |
---|
dequeue, enqueue, getFirst, peek |
Methods inherited from class structure.AbstractLinear |
---|
empty, remove |
Methods inherited from class structure.AbstractStructure |
---|
contains, elements, hashCode, values |
Methods inherited from class java.lang.Object |
---|
equals, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface structure.Queue |
---|
dequeue, empty, enqueue, getFirst, peek |
Methods inherited from interface structure.Structure |
---|
contains, elements, remove, values |
Constructor Detail |
---|
public QueueArray(int size)
size
- The maximum size of the queue.Method Detail |
---|
public void add(Object value)
add
in interface Linear
add
in interface Queue
add
in interface Structure
value
- The value added.AbstractQueue.enqueue(java.lang.Object)
public Object remove()
remove
in interface Linear
remove
in interface Queue
AbstractQueue.dequeue()
public Object get()
get
in interface Linear
get
in interface Queue
public int size()
size
in interface Linear
size
in interface Queue
size
in interface Structure
public void clear()
clear
in interface Structure
public boolean isFull()
public boolean isEmpty()
isEmpty
in interface Structure
isEmpty
in class AbstractStructure
public Iterator iterator()
Structure
iterator
in interface Structure
AbstractIterator
,
Iterator
,
Enumeration
,
Structure.elements()
public String toString()
toString
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |