net.sf.saxon.trace

Class ContextStackIterator

public class ContextStackIterator extends Object implements Iterator

This class provides a representation of the current runtime call stack, as represented by the stack of XPathContext objects.
Constructor Summary
ContextStackIterator(XPathContext context)
Create an iterator over the stack of XPath dynamic context objects, starting with the top-most stackframe and working down.
Method Summary
booleanhasNext()
Returns true if the iteration has more elements.
Objectnext()
Returns the next element in the iteration.
voidremove()
Removes from the underlying collection the last element returned by the iterator (optional operation).

Constructor Detail

ContextStackIterator

public ContextStackIterator(XPathContext context)
Create an iterator over the stack of XPath dynamic context objects, starting with the top-most stackframe and working down. The objects returned by this iterator will be of class ContextStackFrame

Parameters: context the current context

Method Detail

hasNext

public boolean hasNext()
Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)

Returns: true if the iterator has more elements.

next

public Object next()
Returns the next element in the iteration. Calling this method repeatedly until the hasNext method returns false will return each element in the underlying collection exactly once.

Returns: the next element in the iteration, which will always be an instance of ContextStackFrame

Throws: java.util.NoSuchElementException iteration has no more elements.

remove

public void remove()
Removes from the underlying collection the last element returned by the iterator (optional operation).

Throws: UnsupportedOperationException as the remove operation is not supported by this Iterator.