org.jaxen.util

Class PrecedingSiblingAxisIterator

Implemented Interfaces:
Iterator

public class PrecedingSiblingAxisIterator
extends java.lang.Object
implements Iterator

Represents the XPath preceding-sibling axis. The "preceding-sibling axis contains all the preceding siblings of the context node; if the context node is an attribute node or namespace node, the preceding-sibling axis is empty."
Version:
1.2b12

Field Summary

private Object
contextNode
private Navigator
navigator
private Object
nextObj
private Iterator
siblingIter

Constructor Summary

PrecedingSiblingAxisIterator(Object contextNode, Navigator navigator)
Create a new preceding-sibling axis iterator.

Method Summary

boolean
hasNext()
Returns true if there are any preceding siblings remaining; false otherwise.
private void
init()
Object
next()
Returns the next preceding sibling.
void
remove()
This operation is not supported.

Field Details

contextNode

private Object contextNode

navigator

private Navigator navigator

nextObj

private Object nextObj

siblingIter

private Iterator siblingIter

Constructor Details

PrecedingSiblingAxisIterator

public PrecedingSiblingAxisIterator(Object contextNode,
                                    Navigator navigator)
            throws UnsupportedAxisException
Create a new preceding-sibling axis iterator.
Parameters:
contextNode - the node to start from
navigator - the object model specific navigator

Method Details

hasNext

public boolean hasNext()
Returns true if there are any preceding siblings remaining; false otherwise.
Returns:
true if any preceding siblings remain; false otherwise
See Also:
java.util.Iterator.hasNext()

init

private void init()
            throws UnsupportedAxisException

next

public Object next()
            throws NoSuchElementException
Returns the next preceding sibling.
Returns:
the next preceding sibling
See Also:
java.util.Iterator.next()

remove

public void remove()
            throws UnsupportedOperationException
This operation is not supported.