org.apache.xerces.impl

Class XMLDocumentFragmentScannerImpl.ElementStack

protected static class XMLDocumentFragmentScannerImpl.ElementStack extends Object

Element stack. This stack operates without synchronization, error checking, and it re-uses objects instead of throwing popped items away.

Author: Andy Clark, IBM

Field Summary
protected QName[]fElements
The stack data.
protected intfSize
The size of the stack.
Constructor Summary
ElementStack()
Default constructor.
Method Summary
voidclear()
Clears the stack without throwing away existing QName objects.
voidpopElement(QName element)
Pops an element off of the stack by setting the values of the specified QName.
QNamepushElement(QName element)
Pushes an element on the stack.

Field Detail

fElements

protected QName[] fElements
The stack data.

fSize

protected int fSize
The size of the stack.

Constructor Detail

ElementStack

public ElementStack()
Default constructor.

Method Detail

clear

public void clear()
Clears the stack without throwing away existing QName objects.

popElement

public void popElement(QName element)
Pops an element off of the stack by setting the values of the specified QName.

Note: The object returned is not orphaned to the caller. Therefore, the caller should consider the object to be read-only.

pushElement

public QName pushElement(QName element)
Pushes an element on the stack.

Note: The QName values are copied into the stack. In other words, the caller does not orphan the element to the stack. Also, the QName object returned is not orphaned to the caller. It should be considered read-only.

Parameters: element The element to push onto the stack.

Returns: Returns the actual QName object that stores the

Copyright © 1999-2005 Apache XML Project. All Rights Reserved.