com.novell.xml.xpath
Interface ContextNodeList

All Known Implementing Classes:
Axis, Basis, CurrentNodeList, ExpressionContext, NodeSet, Predicate, SingleNodeList

public interface ContextNodeList

An interface that represents a context node list used for evaluating an expression


Field Summary
static int DOCUMENT_ORDER
          When returned from order(), indicates first()-next() product nodes in document order
static int REVERSE_DOCUMENT_ORDER
          When returned from order(), indicates first()-next() product nodes in reverse-document order
static int UNKNOWN_ORDER
          When returned from order(), indicates first()-next() product nodes in something other than document or reverse-document order
 
Method Summary
 int count()
          Return a count of nodes in the context node list.
 Node first()
          Return the first node in the context node list.
 ContextListMark getMark()
          Return a marker to a position in a ContextNodeList.
 Node next()
          Return a the subsequent node in the context node list after a call to first() or next()
 int order()
          Return order in which nodes are returned from first()-next()
 int position()
          Return the position of the last node returned by a call to first() or next()
 Node returnToMark(ContextListMark mark)
          Go to a position in a ContextNodeList previously marked with getMark()
 

Field Detail

DOCUMENT_ORDER

public static final int DOCUMENT_ORDER
When returned from order(), indicates first()-next() product nodes in document order

See Also:
Constant Field Values

REVERSE_DOCUMENT_ORDER

public static final int REVERSE_DOCUMENT_ORDER
When returned from order(), indicates first()-next() product nodes in reverse-document order

See Also:
Constant Field Values

UNKNOWN_ORDER

public static final int UNKNOWN_ORDER
When returned from order(), indicates first()-next() product nodes in something other than document or reverse-document order

See Also:
Constant Field Values
Method Detail

first

public Node first()
           throws XPathEvaluationException
Return the first node in the context node list.

Returns:
First node in list. null is returned if list is empty
Throws:
XPathEvaluationException

next

public Node next()
          throws XPathEvaluationException
Return a the subsequent node in the context node list after a call to first() or next()

Returns:
The next node in the context node list. null is returned if there are no more nodes in the node list
Throws:
XPathEvaluationException

count

public int count()
          throws XPathEvaluationException
Return a count of nodes in the context node list. NOTE: this should be implemented with lazy evaluation if possible, since context node lists can be very large, depending on the document.

Returns:
Count of nodes in the context node list.
Throws:
XPathEvaluationException

position

public int position()
Return the position of the last node returned by a call to first() or next()

Returns:
Node position in node list. 0 is returned if no nodes have been returned. Once first() or next() return null (indicating no more nodes in list) the return will be the position of the last node in the list.

order

public int order()
Return order in which nodes are returned from first()-next()

Returns:
DOCUMENT_ORDER or REVERSE_DOCUMENT_ORDER

getMark

public ContextListMark getMark()
Return a marker to a position in a ContextNodeList. This marker can be used later in a call to returnToMark() to return to a particular position in the list.

Returns:
an opaque marker

returnToMark

public Node returnToMark(ContextListMark mark)
Go to a position in a ContextNodeList previously marked with getMark()

Parameters:
mark - mark returned from getMark()
Returns:
The node at the mark