Back to index

wims  3.65+svn20090927
Public Member Functions | Package Attributes
fr.ove.utils.Queue.QueueEnumerator Class Reference
Inheritance diagram for fr.ove.utils.Queue.QueueEnumerator:
Inheritance graph
[legend]
Collaboration diagram for fr.ove.utils.Queue.QueueEnumerator:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 QueueEnumerator (Queue queue)
 The constructor.
boolean hasMoreElements ()
 Tests if this enumeration contains more elements.
Object nextElement ()
 Returns the next element of this enumeration.

Package Attributes

Queue queue
 The queue to enumerate.
LinkedElement next
 The next element in the queue;.

Detailed Description

Definition at line 159 of file Queue.java.


Constructor & Destructor Documentation

The constructor.

Parameters:
queuethe queue to enumerate

Definition at line 174 of file Queue.java.

                                            {
            this.queue = queue;
            next = queue.head;
        }

Member Function Documentation

Tests if this enumeration contains more elements.

Returns:
true if this enumeration contains more elements; false otherwise.

Definition at line 185 of file Queue.java.

                                         {
            return (next != null);
        }

Returns the next element of this enumeration.

Returns:
the next element of this enumeration.
Exceptions:
NoSuchElementExceptionif no more elements exist.

Definition at line 195 of file Queue.java.

                                    {
              synchronized (queue) {
                  if (next != null) {
                      Object element = next.getElement();
                      next = next.getPrevious();
                     return element;
              }
              }
              
              throw new NoSuchElementException("QueueEnumerator");
        }

Here is the call graph for this function:


Member Data Documentation

The next element in the queue;.

Definition at line 168 of file Queue.java.

The queue to enumerate.

Definition at line 163 of file Queue.java.


The documentation for this class was generated from the following file: