API

com.ibm.xml.xapi
Interface XSequenceCursor

All Superinterfaces:
XItemView, XNodeView

public interface XSequenceCursor
extends XItemView

Represents a sequence of items providing cursor access to the items. Cursor traversal can be achieved through the toNext and toPrevious methods. When either of these methods is used the cursor will change state as it will now be pointing to a different item in the sequence. This means that other references to the same XSequenceCursor object will also now be pointing to the next or previous item.

XSequenceCursor implements XItemView so that each item can be examined as the cursor is traversed. XItemView in turn implements XNodeView so that items of complex type can be examined as well.

Note that null is used to represent an empty sequence so an XSequenceCursor will always contain at least one item.

See Also:
XItemView, XNodeView

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ibm.xml.xapi.XNodeView
XNodeView.Kind
 
Method Summary
 XSequenceCursor append(XItemView item)
          Create a new sequence cursor by appending the specified item to this sequence.
 XSequenceCursor append(XSequenceCursor sequence)
          Create a new sequence cursor by appending the items in the specified sequence to this sequence.
 List<XItemView> exportAsList()
          Exports the sequence as a List.
 void exportSequence(Result result)
          Export the sequence to a Result using the default output parameter settings.
 void exportSequence(Result result, XOutputParameters parameters)
          Export the sequence to a Result according to the specified output parameters.
 XItemView getSingletonItem()
          Get the current item as a singleton.
 boolean toNext()
          Moves the cursor to the next item in the sequence.
 boolean toPrevious()
          Moves the cursor to the previous item in the sequence.
 
Methods inherited from interface com.ibm.xml.xapi.XItemView
exportItem, exportItem, getAnyURIValue, getBase64BinaryValue, getBooleanValue, getByteValue, getDateTimeValue, getDateValue, getDayTimeDurationValue, getDecimalValue, getDoubleValue, getDurationValue, getFloatValue, getGDayValue, getGMonthDayValue, getGMonthValue, getGYearMonthValue, getGYearValue, getHexBinaryValue, getIntegerValue, getIntValue, getListValue, getLongValue, getNotationValue, getObjectValue, getQNameValue, getShortValue, getStringValue, getTimeValue, getUnionValue, getValueType, getValueTypeName, getYearMonthDurationValue, isAtomic
 
Methods inherited from interface com.ibm.xml.xapi.XNodeView
getDOMNode, getKind, getNodeQName, getTreeCursor, isSameDocument, relativePosition
 

Method Detail

toNext

boolean toNext()
Moves the cursor to the next item in the sequence.

Returns:
Returns true if the move was successful, false otherwise (if the cursor was already at the end of the sequence).

toPrevious

boolean toPrevious()
Moves the cursor to the previous item in the sequence.

Returns:
Returns true if the move was successful, false otherwise (if the cursor was already at the beginning of the sequence).

getSingletonItem

XItemView getSingletonItem()
Get the current item as a singleton. This method does not need to be called in order to examine the current item since XSequenceCursor implements XItemView. It is intended to be called only when a standalone item is needed that will not be affected by calls to toNext and toPrevious on the original sequence.

Returns:
A singleton XItemView object for the current item.

exportAsList

List<XItemView> exportAsList()
Exports the sequence as a List. The full sequence will be exported regardless of the current position of the cursor in the sequence. The resulting list will not be affected by any calls to toNext and toPrevious on the original sequence.

Returns:
The entire sequence as a List of XItemView.

exportSequence

void exportSequence(Result result,
                    XOutputParameters parameters)
Export the sequence to a Result according to the specified output parameters. The full sequence will be exported regardless of the current position of the cursor in the sequence. Note that standalone attribute and namespace nodes cannot be serialized. See Sequence Normalization for more details.

Supported Result types are:

Parameters:
result - The Result to export to.
parameters - The output parameter settings. See XOutputParameters.

exportSequence

void exportSequence(Result result)
Export the sequence to a Result using the default output parameter settings. The full sequence will be exported regardless of the current position of the cursor in the sequence. Note that standalone attribute and namespace nodes cannot be serialized. See Sequence Normalization for more details.

Supported Result types are:

Parameters:
result - The Result to export to.

append

XSequenceCursor append(XItemView item)
Create a new sequence cursor by appending the specified item to this sequence. The full sequence will be used regardless of the current position in the sequence. The resulting sequence will be positioned at the first item.

Parameters:
item - The item to append.
Returns:
A new sequence cursor containing all the items in this sequence with the given item appended at the end.

append

XSequenceCursor append(XSequenceCursor sequence)
Create a new sequence cursor by appending the items in the specified sequence to this sequence. The full set of items will be used regardless of the current position in either sequence. The resulting sequence will be positioned at the first item.

Parameters:
sequence - The sequence of items to append.
Returns:
A new sequence cursor containing all the items in this sequence with the items in the given sequence appended at the end.

IBM Copyright 2004-2008