Devsphere.com


com.devsphere.xml.saxdomix.helpers
Class ElementStack

java.lang.Object
  |
  +--com.devsphere.xml.saxdomix.helpers.ElementStack

public class ElementStack
extends java.lang.Object

This is a stack implementation for DOM Element nodes. It is used internally by the builder classes of the framework.


Constructor Summary
ElementStack()
          Creates a new empty stack.
 
Method Summary
 void clear()
          Removes all elements of this stack.
 boolean isEmpty()
          Indicates whether this stack contains no elements.
 org.w3c.dom.Element peek()
          Returns the element at the top of this stack without removing it.
 org.w3c.dom.Element pop()
          Removes the element at the top of this stack and returns it.
 void push(org.w3c.dom.Element elem)
          Pushes an element onto the top of this stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementStack

public ElementStack()
Creates a new empty stack.

Method Detail

push

public void push(org.w3c.dom.Element elem)
Pushes an element onto the top of this stack.

Parameters:
elem - The new top element for this stack

pop

public org.w3c.dom.Element pop()
Removes the element at the top of this stack and returns it.

Returns:
The element that was just removed from this stack

peek

public org.w3c.dom.Element peek()
Returns the element at the top of this stack without removing it.

Returns:
The top element of this stack

clear

public void clear()
Removes all elements of this stack.


isEmpty

public boolean isEmpty()
Indicates whether this stack contains no elements.

Returns:
true if this stack is empty; false otherwise

 Devsphere.com