electric.xml
Class Nodes

java.lang.Object
  extended byelectric.xml.Nodes
All Implemented Interfaces:
java.util.Enumeration
Direct Known Subclasses:
Attributes, Children, Elements

public class Nodes
extends java.lang.Object
implements java.util.Enumeration

Nodes is an enumeration over a collection of nodes. To iterate through the collection in a typesafe way, use current(), first() and next().

Author:
webMethods

Field Summary
protected  Node current
           
protected  NodeList list
           
 
Constructor Summary
Nodes()
           
Nodes(Node node)
           
Nodes(NodeList list)
           
 
Method Summary
 Node currentNode()
          Return the current Node, or null if there is none.
 Node firstNode()
          Move to the first Node and return it, or null if there is none.
 NodeList getNodeList()
          Return my underlying NodeList.
 boolean hasMoreElements()
          Return true if there are more Nodes to read in the enumeration.
 java.lang.Object nextElement()
          Return the current Node and then advance to the next one if present.
 Node nextNode()
          Return the current Node and then advance to the next one if present.
 void remove()
          Remove all the nodes from the current Node to the last Node.
 void reset()
          Move to the first Node.
 int size()
          Return the number of Nodes in the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

protected NodeList list

current

protected Node current
Constructor Detail

Nodes

public Nodes()

Nodes

public Nodes(NodeList list)
Parameters:
list -

Nodes

public Nodes(Node node)
Parameters:
node -
Method Detail

hasMoreElements

public boolean hasMoreElements()
Return true if there are more Nodes to read in the enumeration.

Specified by:
hasMoreElements in interface java.util.Enumeration

nextElement

public java.lang.Object nextElement()
Return the current Node and then advance to the next one if present.

Specified by:
nextElement in interface java.util.Enumeration

reset

public void reset()
Move to the first Node.


currentNode

public Node currentNode()
Return the current Node, or null if there is none.


firstNode

public Node firstNode()
Move to the first Node and return it, or null if there is none.


nextNode

public Node nextNode()
Return the current Node and then advance to the next one if present.


size

public int size()
Return the number of Nodes in the list.


remove

public void remove()
Remove all the nodes from the current Node to the last Node.


getNodeList

public NodeList getNodeList()
Return my underlying NodeList.



copyright© 2001-2004 by webMethods All Rights Reserved.