mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-02 07:05:24 +00:00
c28a8d139f
Some new, some old filres copiedfrom Rhino to form start of prototyping environment for Project Brenda
36 lines
683 B
Java
36 lines
683 B
Java
/* -*- Mode: java; tab-width: 8 -*-
|
|
* Copyright © 1997, 1998 Netscape Communications Corporation, All Rights Reserved.
|
|
*/
|
|
|
|
import java.util.Enumeration;
|
|
|
|
/**
|
|
* This class implements a child iterator for the Node class.
|
|
*
|
|
* @see Node
|
|
* @author Norris Boyd
|
|
*/
|
|
class ShallowNodeIterator implements Enumeration {
|
|
|
|
public ShallowNodeIterator(Node n) {
|
|
current = n;
|
|
}
|
|
|
|
public boolean hasMoreElements() {
|
|
return current != null;
|
|
}
|
|
|
|
public Object nextElement() {
|
|
return nextNode();
|
|
}
|
|
|
|
public Node nextNode() {
|
|
Node result = current;
|
|
current = current.next;
|
|
return result;
|
|
}
|
|
|
|
private Node current;
|
|
}
|
|
|