MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.iterators.forseq
Class ForseqWindowIterator

java.lang.Object
  extended by ch.ethz.mxquery.model.Iterator
      extended by ch.ethz.mxquery.model.TokenBasedIterator
          extended by ch.ethz.mxquery.iterators.forseq.ForseqIterator
              extended by ch.ethz.mxquery.iterators.forseq.ForseqWindowIterator
All Implemented Interfaces:
XDMIterator, Traversable
Direct Known Subclasses:
ForseqWindowEarlyBinding, ForseqWindowEarlyBindingParallel, ForseqWindowIndexIterator, ForseqWindowNaiveIterator

public abstract class ForseqWindowIterator
extends ForseqIterator

Basic helper class for all windows. As every window implementation has some stuff in common, this class was introduced


Field Summary
 
Fields inherited from class ch.ethz.mxquery.iterators.forseq.ForseqIterator
GENERAL_WINDOW, LANDMARK_WINDOW, ORDER_MODE_END, ORDER_MODE_ENDSTART, ORDER_MODE_NONE, SLIDING_WINDOW, TUMBLING_WINDOW
 
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
ForseqWindowIterator(Context ctx, int windowType, QName var, TypeInfo type, XDMIterator seq, WindowVariable[] startVars, XDMIterator startExpr, WindowVariable[] endVars, XDMIterator endExpr, boolean forceEnd, boolean onNewStart, int orderMode, QueryLocation location)
          Creates a new Window Iterator
 
Method Summary
 XDMIterator[] getAllSubIters()
           
 QName[] getForseqVars()
          Get the name of all variables (possibly) bound by this Forseq window iterator instance
 Context getInnermostContext()
           
 void setContext(Context context, boolean recursive)
          Assigns a context for this iterator (and possibly for its subIterators), replacing the existing context
 void setResettable(boolean r)
          Set this Iterator (and its subiterators) resetable.
 KXmlSerializer traverseIteratorTree(KXmlSerializer serializer)
           
 void updateVarHolders(XQDynamicContext ctx)
          Set the variable holder using this context Access is public, since for parallel execution each new binding goes into new varHolders
 
Methods inherited from class ch.ethz.mxquery.iterators.forseq.ForseqIterator
copy, getForseqVariable, isParallelAccess, next, setParallelAccess
 
Methods inherited from class ch.ethz.mxquery.model.Iterator
addPredicates, close, copyInts, copyIterators, copyQNames, copyStrings, copyTypeInfos, getAllSubItersRecursive, getContext, getExpressionCategoryType, getLoc, getPendingUpdateList, getPredicates, getStaticType, getSubIters, hasPredicates, isConstModePreserve, isExprParameter, isOpen, isResettable, removePredicates, reset, setConstModePreserve, setLoc, setOrderByExpr, setParam, setReturnExpr, setSubIters, setSubIters, setSubIters, setWhereExpr, traverse
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForseqWindowIterator

public ForseqWindowIterator(Context ctx,
                            int windowType,
                            QName var,
                            TypeInfo type,
                            XDMIterator seq,
                            WindowVariable[] startVars,
                            XDMIterator startExpr,
                            WindowVariable[] endVars,
                            XDMIterator endExpr,
                            boolean forceEnd,
                            boolean onNewStart,
                            int orderMode,
                            QueryLocation location)
                     throws MXQueryException
Creates a new Window Iterator

Parameters:
windowType - Type of the window
var - Variable QName
type - Type of the variable (not supported at the moment)
seq - The source iterator
startVars - List of all start WindowVariables
startExpr - The start expression iterator
endVars - List of all end WindowVariables
endExpr - The end expression iterator
forceEnd - If a force of the end should be applied
onNewStart - If the end expressions is newstart
orderMode - Order mode of the iterator
Throws:
MXQueryException
Method Detail

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

getAllSubIters

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

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

getInnermostContext

public Context getInnermostContext()

updateVarHolders

public void updateVarHolders(XQDynamicContext ctx)
                      throws MXQueryException
Set the variable holder using this context Access is public, since for parallel execution each new binding goes into new varHolders

Parameters:
ctx - Context from which to resolve the variables into varHolders
Throws:
MXQueryException

getForseqVars

public QName[] getForseqVars()
Get the name of all variables (possibly) bound by this Forseq window iterator instance

Returns:
a sequence of variable names

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich