net.xineo.xml.util
Class ElementNameStack

java.lang.Object
  |
  +--net.xineo.xml.util.ElementNameStack
All Implemented Interfaces:
java.lang.Cloneable

public class ElementNameStack
extends java.lang.Object
implements java.lang.Cloneable

Defines a stack of element names.


Constructor Summary
ElementNameStack()
          Constructs an empty element stack.
 
Method Summary
 java.lang.Object clone()
           
 boolean empty()
          Tests if the stack is empty.
 ElementName peek()
          Returns the element on top of the stack without removing it.
 ElementName peek(int offset)
          Returns an element given by its depth in the stack starting from the top, without removing it.
 ElementName pop()
          Removes the element name on top of the stack, and returns it.
 void push(ElementName elementName)
          Adds an element name on top of the stack.
 int size()
          Returns the count of elements contained in this stack.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementNameStack

public ElementNameStack()
Constructs an empty element stack.

Method Detail

push

public void push(ElementName elementName)
Adds an element name on top of the stack.

Parameters:
elementName - The element name to be pushed

pop

public ElementName pop()
Removes the element name on top of the stack, and returns it.

Returns:
The element name that was on the top of the stack

empty

public boolean empty()
Tests if the stack is empty.

Returns:
True if the stack is empty, and false otherwise.

size

public int size()
Returns the count of elements contained in this stack.

Returns:
The stack size

peek

public ElementName peek()
Returns the element on top of the stack without removing it.

Returns:
The element on top of the stack

peek

public ElementName peek(int offset)
Returns an element given by its depth in the stack starting from the top, without removing it.

Parameters:
offset - the offset of the given element starting from the top of the stack
Returns:
The corresponding element

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object


Copyright © 2002 Frédérik Bilhaut - Xineo.NET