# NOT A PART OF SEAMONKEY IN ANY WAY
Some new, some old filres copiedfrom Rhino to form start of prototyping environment for Project Brenda git-svn-id: svn://10.0.0.236/trunk@27571 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
35
mozilla/js/js2/java/ShallowNodeIterator.java
Normal file
35
mozilla/js/js2/java/ShallowNodeIterator.java
Normal file
@@ -0,0 +1,35 @@
|
||||
/* -*- 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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user