MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.iterators
Class FFLWORIterator

java.lang.Object
  extended by ch.ethz.mxquery.model.Iterator
      extended by ch.ethz.mxquery.model.CurrentBasedIterator
          extended by ch.ethz.mxquery.iterators.FFLWORIterator
All Implemented Interfaces:
XDMIterator, Traversable
Direct Known Subclasses:
PFFLWORIterator

public class FFLWORIterator
extends CurrentBasedIterator


Nested Class Summary
 class FFLWORIterator.CFAdapter
          This Adapter is needed to enable break and continue during return-materialization in order by.
 
Field Summary
 
Fields inherited from interface ch.ethz.mxquery.model.XDMIterator
EXPR_CATEGORY_SEQUENTIAL, EXPR_CATEGORY_SIMPLE, EXPR_CATEGORY_UPDATING, EXPR_CATEGORY_VACUOUS, EXPR_PARAM_CHEAPEVAL, EXPR_PARAM_VARIABLE, EXPR_PARAM_WINDOW, EXPR_PARAM_XDMGEN
 
Constructor Summary
FFLWORIterator(Context ctx, XDMIterator[] subIters, XDMIterator whereExpr, OrderByIterator orderByExpr, XDMIterator returnExpr, QueryLocation location)
           
 
Method Summary
 XDMIterator copy(Context parentIterContext, XQStaticContext newParentIterContext, boolean copyContext, java.util.Vector nestedPredCtxStack)
          Copies the Iterator.
 boolean doNextBinding()
          Starts the binding.
 XDMIterator[] getAllSubIters()
           
 XDMIterator getOrderByExpr()
           
 XDMIterator getReturnExpr()
           
 TypeInfo getStaticType()
          Return the return type if it can be statically determined
 XDMIterator[] getSubIters()
           
 XDMIterator getWhereExpr()
           
 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 setContext(Context context, boolean recursive)
          Assigns a context for this iterator (and possibly for its subIterators), replacing the existing context
 void setOrderByExpr(OrderByIterator oExpr)
           
 void setResettable(boolean r)
          Set this Iterator (and its subiterators) resetable.
 void setReturnExpr(XDMIterator retExpr)
           
 void setWhereExpr(XDMIterator wExpr)
           
 KXmlSerializer traverseIteratorTree(KXmlSerializer serializer)
           
 
Methods inherited from class ch.ethz.mxquery.model.Iterator
addPredicates, close, copyInts, copyIterators, copyQNames, copyStrings, copyTypeInfos, getAllSubItersRecursive, getContext, getExpressionCategoryType, getLoc, getPendingUpdateList, getPredicates, hasPredicates, isConstModePreserve, isExprParameter, isOpen, isResettable, removePredicates, reset, setConstModePreserve, setLoc, setOrderByExpr, setParam, setSubIters, setSubIters, setSubIters, traverse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FFLWORIterator

public FFLWORIterator(Context ctx,
                      XDMIterator[] subIters,
                      XDMIterator whereExpr,
                      OrderByIterator orderByExpr,
                      XDMIterator returnExpr,
                      QueryLocation location)
               throws MXQueryException
Throws:
MXQueryException
Method Detail

setReturnExpr

public void setReturnExpr(XDMIterator retExpr)
Overrides:
setReturnExpr in class Iterator

setWhereExpr

public void setWhereExpr(XDMIterator wExpr)
Overrides:
setWhereExpr in class Iterator

setOrderByExpr

public void setOrderByExpr(OrderByIterator oExpr)

next

public Token next()
           throws MXQueryException
Description copied from interface: XDMIterator
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:
MXQueryException

doNextBinding

public boolean doNextBinding()
                      throws MXQueryException
Starts the binding. Returns true if successful otherwise false (means the last binding was done)

Returns:
can the next binding be performed
Throws:
MXQueryException

setContext

public void setContext(Context context,
                       boolean recursive)
                throws MXQueryException
Description copied from interface: XDMIterator
Assigns a context for this iterator (and possibly for its subIterators), replacing the existing context

Specified by:
setContext in interface XDMIterator
Overrides:
setContext in class Iterator
Parameters:
context - the context to assign
recursive - true perform the assignment also subiteratos, false only replace on the current iterator
Throws:
MXQueryException

setResettable

public void setResettable(boolean r)
                   throws MXQueryException
Description copied from interface: XDMIterator
Set this Iterator (and its subiterators) resetable. Resetable iterators may require more space (trading buffered data against recomputation)

Specified by:
setResettable in interface XDMIterator
Overrides:
setResettable in class Iterator
Parameters:
r - true make this iterator resetable, false make it not resetable
Throws:
MXQueryException

getSubIters

public XDMIterator[] getSubIters()
Specified by:
getSubIters in interface XDMIterator
Overrides:
getSubIters in class Iterator

getAllSubIters

public XDMIterator[] getAllSubIters()
Specified by:
getAllSubIters in interface XDMIterator
Overrides:
getAllSubIters in class Iterator

getOrderByExpr

public XDMIterator getOrderByExpr()

getReturnExpr

public XDMIterator getReturnExpr()

getWhereExpr

public XDMIterator getWhereExpr()

traverseIteratorTree

public KXmlSerializer traverseIteratorTree(KXmlSerializer serializer)
                                    throws java.lang.Exception
Specified by:
traverseIteratorTree in interface XDMIterator
Overrides:
traverseIteratorTree in class Iterator
Throws:
java.lang.Exception

copy

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

Specified by:
copy in interface XDMIterator
Overrides:
copy in class Iterator
Parameters:
parentIterContext - The new parent context
newParentIterContext - 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

getStaticType

public TypeInfo getStaticType()
Description copied from interface: XDMIterator
Return the return type if it can be statically determined

Specified by:
getStaticType in interface XDMIterator
Overrides:
getStaticType in class Iterator
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*

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich