|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectIntQueue
This class implements queues of integers as linked lists
from the class IntList. Insertions are
made at the rear and deletions at the front. The link
is from front to rear.
| Constructor Summary | |
IntQueue()
|
|
| Method Summary | |
void |
add(int val)
Adds the integer val to the queue. |
void |
add(IntList l)
Adds the list l at the rear of the queue. |
IntQueue |
append(IntQueue x)
Concatenates the current queue and the queue s. |
IntQueue |
concat(IntQueue x)
A variant of append(). |
boolean |
isEmpty()
Returns true if the queue is empty. |
int |
lastVal()
Returns the last element of the queue. |
IntList |
remove()
Removes the first element of the queue. |
void |
removeAll()
Empties the queue. |
int |
removeVal()
Returns the penultimate value. |
void |
seizeAll(IntQueue s)
Adds all the elements of the queue s
and empties s. |
java.lang.String |
show(java.lang.String name)
|
int |
size()
Returns the size of the queue. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public IntQueue()
| Method Detail |
public void add(int val)
val to the queue.
val - an integer.public void add(IntList l)
l at the rear of the queue.
l - a linked list of integers.public IntList remove()
null if the queue is empty.
public void removeAll()
public boolean isEmpty()
public int size()
public int lastVal()
public int removeVal()
public void seizeAll(IntQueue s)
s
and empties s.
public java.lang.String toString()
public java.lang.String show(java.lang.String name)
public IntQueue append(IntQueue x)
s.
public IntQueue concat(IntQueue x)
append().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||