MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.model
Interface XDMIterator

All Superinterfaces:
Traversable
All Known Subinterfaces:
XMLSource
All Known Implementing Classes:
Abs, AdditiveIterator, ApplyExprIterator, AssignIterator, AttributeIterator, Avg, BaseUri, BlockDeclIterator, BlockIterator, BooleanIterator, BreakContinueIterator, CastAsIterator, CatchIterator, Ceiling, ChildIterator, CodePointEqual, CodepointsToString, Collection, Compare, CompareIterator, ComputedCommentConstrIterator, ComputedPIConstrIterator, ComputedTextConstrIterator, Concat, Contains, CountIterator, CurrentBasedIterator, CurrentDate, CurrentDateTime, CurrentTime, DataValuesIterator, DateTime, DateTimeAdjustTimezone, DateTimeValues, DayTimeDurationValues, Deep_equal, DefaultCollation, DeleteIterator, DescendantOrSelfIterator, DirectXMLWrapperIterator, DistinctValuesIterator, Doc, DocAvailable, DocOrderIterator, DocumentUri, EarlyReturnIterator, Empty, EmptySequenceIterator, EncodeForURI, EndsWith, Eratosthenes, Error, EscapeHTMLURI, Exactly_one, ExceptIterator, Exists, ExternalFunctionExample.SingleValueExtFunction, False, FFLWORIterator, FFLWORIterator.CFAdapter, Floor, FNQName, FNString, ForIterator, ForseqGeneralIterator, ForseqIterator, ForseqWindowEarlyBinding, ForseqWindowEarlyBindingParallel, ForseqWindowIndexIterator, ForseqWindowIterator, ForseqWindowNaiveIterator, FTContainsIterator, GroupByIndexIterator, HttpIO, Id, Idref, IfThenElseIterator, ImplicitTimezone, In_scope_prefixes, Index_of, InputOutputExample.RelWrapper, InsertBefore, InsertIterator, InstanceOfIterator, IntersectIterator, IRItoURI, Iterator, Lang, Last, LastItem, LetIterator, LLStoreIterator, Local_name, Local_name_from_QName, LogicalIterator, LowerCase, Matches, MaxMin, MultiplicativeIterator, Name, Namespace_uri, Namespace_uri_for_prefix, Namespace_uri_from_QName, Nilled, Node_Name, NodeIterator, NonSchemaValidatingSaxImportAdapter, NonValidatingDOMAdapter, NonValidatingStaxAdapter, NormalizeSpace, NormalizeUnicode, Not, Number, One_or_more, OrderByIterator, ParentIterator, ParseStringToXML, PFFLWORIterator, Position, Pow, PredicateIterator, Prefix_from_QName, Print, Put, QuantifiedIterator, Random, RangeIterator, ReadlineIterator, Remove, RenameIterator, Replace, ReplaceIterator, ResolveQName, ResolveUri, ResultDataItemsIterator, ResultDataIterator, Reverse, RewriteExpression, Root, Round, RoundHalfToEven, Score, SelfAxisIterator, SequenceIterator, SequenceTypeIterator, SerializeXMLToString, Soap_call, Sqrt, StartsWith, StaticBaseUri, String_Length, StringJoin, StringToCodepoints, SubFiles, SubFiles2, SubSequenceIterator, SubString, SubstringAfter, SubstringBefore, Sum, Tidy, TokenBasedIterator, TokenIterator, Tokenize, TokenSequenceIterator, Trace, TransformIterator, Translate, TransMath, TreatAsIterator, True, TryIterator, TypeSwitchIterator, UnionIterator, Unordered, UpdateIterator, UpperCase, UserdefFuncCall, UserdefFuncCallLateBinding, Uuid, ValidatedSaxImportAdapter, ValidateIterator, VariableIterator, WhileIterator, Window, WindowEarlyBinding, WindowEarlyBindingParallel, WindowEmptySequenceIterator, WindowItemIterator, WindowIterator, WindowSequenceIterator, WindowTokenIterator, WrapperIterator, WSFunction, XDMImportAdapter, XMLAttrIterator, XMLContent, XPPImportAdapter, XSBinary, XSBoolean, XSConstructorIterator, XSDate, XSDateTime, XSDayTimeDuration, XSDecimal, XSDouble, XSDuration, XSFloat, XSGregorian, XSInteger, XSQName, XSString, XSTime, XSYearMonthDuration, Zero_or_one

public interface XDMIterator
extends Traversable

The interface of all iterators producing XDM and/or PUL The computation of XDM/PUL is done lazily, whenever possible Iterators form a tree structure, representing the XQuery expressions


Field Summary
static int EXPR_CATEGORY_SEQUENTIAL
           
static int EXPR_CATEGORY_SIMPLE
           
static int EXPR_CATEGORY_UPDATING
           
static int EXPR_CATEGORY_VACUOUS
           
static int EXPR_PARAM_CHEAPEVAL
           
static int EXPR_PARAM_VARIABLE
           
static int EXPR_PARAM_WINDOW
           
static int EXPR_PARAM_XDMGEN
           
 
Method Summary
 void close(boolean restartable)
          Frees the state of the iterator and all subiterators.
 XDMIterator copy(Context parentIterContext, XQStaticContext prevParentIterContext, boolean copyContext, java.util.Vector nestedPredCtxStack)
          Copies the Iterator.
 XDMIterator[] getAllSubIters()
           
 java.util.Vector getAllSubItersRecursive()
           
 Context getContext()
          Retrieve the (unified) context of this iterators, carrying both dynamic and static information
 int getExpressionCategoryType(boolean scripting)
          Get and (check) the expression category type, as defined in the XQSF draft Expression categories are: SIMPLE, UPDATING, SEQUENTIAL, VACUOUS If the categories are incompatible, the related exception is thrown The check is only done when requested by calling this function The implementation covers the common case (simple expressions, no checking) and needs to be overwritten for checking and also by updating, sequential and vacuous expressions
 QueryLocation getLoc()
          Get the location in the XQuery source where this operator comes from
 PendingUpdateList getPendingUpdateList()
          Returns the complete Pending Update List (PUL) of this iterator.
 TypeInfo getStaticType()
          Return the return type if it can be statically determined
 XDMIterator[] getSubIters()
           
 boolean isConstModePreserve()
           
 boolean isExprParameter(int valueToCheck, boolean recursive)
          Optimization check
 boolean isOpen()
           
 boolean isResettable()
          Retrieve if this iterator is resetable
 Token next()
          Produces the next XDM token This method typically implements the base functionality of an Iterator and computes the value of the next token.
 void reset()
          Resets the Iterator to its original state, without discarding expensive state
 void setConstModePreserve(boolean constModePreserve)
           
 void setContext(Context context, boolean recursive)
          Assigns a context for this iterator (and possibly for its subIterators), replacing the existing context
 void setLoc(QueryLocation loc)
          Set the location in the XQuery source where this operator comes from
 void setResettable(boolean r)
          Set this Iterator (and its subiterators) resetable.
 void setSubIters(XDMIterator subIt)
           
 void setSubIters(XDMIterator[] subIt)
           
 KXmlSerializer traverseIteratorTree(KXmlSerializer serializer)
           
 
Methods inherited from interface ch.ethz.mxquery.util.Traversable
traverse
 

Field Detail

EXPR_CATEGORY_SIMPLE

static final int EXPR_CATEGORY_SIMPLE
See Also:
Constant Field Values

EXPR_CATEGORY_UPDATING

static final int EXPR_CATEGORY_UPDATING
See Also:
Constant Field Values

EXPR_CATEGORY_SEQUENTIAL

static final int EXPR_CATEGORY_SEQUENTIAL
See Also:
Constant Field Values

EXPR_CATEGORY_VACUOUS

static final int EXPR_CATEGORY_VACUOUS
See Also:
Constant Field Values

EXPR_PARAM_VARIABLE

static final int EXPR_PARAM_VARIABLE
See Also:
Constant Field Values

EXPR_PARAM_WINDOW

static final int EXPR_PARAM_WINDOW
See Also:
Constant Field Values

EXPR_PARAM_CHEAPEVAL

static final int EXPR_PARAM_CHEAPEVAL
See Also:
Constant Field Values

EXPR_PARAM_XDMGEN

static final int EXPR_PARAM_XDMGEN
See Also:
Constant Field Values
Method Detail

next

Token next()
           throws MXQueryException
Produces the next XDM token This method typically implements the base functionality of an Iterator and computes the value of the next token.

Returns:
The XDM token representing the next fragment of the XDM instance
Throws:
If - any error occurs during the computation of this token
MXQueryException

reset

void reset()
           throws MXQueryException
Resets the Iterator to its original state, without discarding expensive state

Throws:
MXQueryException

close

void close(boolean restartable)
           throws MXQueryException
Frees the state of the iterator and all subiterators.

Parameters:
restartable - make the iterator restartable (otherwise the iterator will stay closed with additional next calls)
Throws:
MXQueryException

getPendingUpdateList

PendingUpdateList getPendingUpdateList()
                                       throws MXQueryException
Returns the complete Pending Update List (PUL) of this iterator. Is null for non-updating expressions. Since the PUL is computed gradually (especially in a scripting environment, this function should only be called when the evaluation is complete. For scripting, this function also merges the PULs of the child iterators, so

Returns:
pending update list
Throws:
MXQueryException

getStaticType

TypeInfo getStaticType()
Return the return type if it can be statically determined

Returns:
a Type info carrying the most precise static type that could be determined. If no specific type could be determined, the type is ITEM*

getExpressionCategoryType

int getExpressionCategoryType(boolean scripting)
                              throws MXQueryException
Get and (check) the expression category type, as defined in the XQSF draft Expression categories are: SIMPLE, UPDATING, SEQUENTIAL, VACUOUS If the categories are incompatible, the related exception is thrown The check is only done when requested by calling this function The implementation covers the common case (simple expressions, no checking) and needs to be overwritten for checking and also by updating, sequential and vacuous expressions

Parameters:
scripting - TODO
Returns:
the most stringent expression type
Throws:
MXQueryException: - if the categories are incompatible, raise the related exception
MXQueryException

copy

XDMIterator copy(Context parentIterContext,
                 XQStaticContext prevParentIterContext,
                 boolean copyContext,
                 java.util.Vector nestedPredCtxStack)
                 throws MXQueryException
Copies the Iterator. The context is copied (if necessary) here. The subIterators are copied (if existing) here.

Parameters:
parentIterContext - The new parent context
prevParentIterContext - The previous context of the parent iterator
copyContext - Copy the context or use the parent context
nestedPredCtxStack - The Stack of nested predicate context, needed for nested rewritten predicates
Returns:
A copy of this Iterator
Throws:
MXQueryException

setResettable

void setResettable(boolean r)
                   throws MXQueryException
Set this Iterator (and its subiterators) resetable. Resetable iterators may require more space (trading buffered data against recomputation)

Parameters:
r - true make this iterator resetable, false make it not resetable
Throws:
MXQueryException

isResettable

boolean isResettable()
                     throws MXQueryException
Retrieve if this iterator is resetable

Returns:
true this iterator is resetable, false it is not
Throws:
MXQueryException

getContext

Context getContext()
Retrieve the (unified) context of this iterators, carrying both dynamic and static information

Returns:
a Context object

setContext

void setContext(Context context,
                boolean recursive)
                throws MXQueryException
Assigns a context for this iterator (and possibly for its subIterators), replacing the existing context

Parameters:
context - the context to assign
recursive - true perform the assignment also subiteratos, false only replace on the current iterator
Throws:
MXQueryException

getLoc

QueryLocation getLoc()
Get the location in the XQuery source where this operator comes from

Returns:
the QueryLocation object representing the location

setLoc

void setLoc(QueryLocation loc)
Set the location in the XQuery source where this operator comes from

Parameters:
loc - the QueryLocation object representing the location

isExprParameter

boolean isExprParameter(int valueToCheck,
                        boolean recursive)
Optimization check

Parameters:
valueToCheck -
recursive -
Returns:
if iterator fulfills the requested criteria

setSubIters

void setSubIters(XDMIterator[] subIt)
                 throws MXQueryException
Throws:
MXQueryException

setSubIters

void setSubIters(XDMIterator subIt)

getSubIters

XDMIterator[] getSubIters()
                          throws MXQueryException
Throws:
MXQueryException

getAllSubIters

XDMIterator[] getAllSubIters()

getAllSubItersRecursive

java.util.Vector getAllSubItersRecursive()

isOpen

boolean isOpen()

isConstModePreserve

boolean isConstModePreserve()

setConstModePreserve

void setConstModePreserve(boolean constModePreserve)

traverseIteratorTree

KXmlSerializer traverseIteratorTree(KXmlSerializer serializer)
                                    throws java.lang.Exception
Throws:
java.lang.Exception

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich