home *** CD-ROM | disk | FTP | other *** search
- package sun.misc;
-
- import java.util.Enumeration;
- import java.util.NoSuchElementException;
-
- final class LIFOQueueEnumerator implements Enumeration {
- Queue queue;
- QueueElement cursor;
-
- LIFOQueueEnumerator(Queue var1) {
- this.queue = var1;
- this.cursor = var1.head;
- }
-
- public boolean hasMoreElements() {
- return this.cursor != null;
- }
-
- public Object nextElement() {
- Queue var1 = this.queue;
- synchronized(var1) {
- if (this.cursor != null) {
- QueueElement var2 = this.cursor;
- this.cursor = this.cursor.next;
- Object var3 = var2.obj;
- return var3;
- }
- }
-
- throw new NoSuchElementException("LIFOQueueEnumerator");
- }
- }
-