MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.iterators
Class UserdefFuncCall

java.lang.Object
  extended by ch.ethz.mxquery.model.Iterator
      extended by ch.ethz.mxquery.model.CurrentBasedIterator
          extended by ch.ethz.mxquery.iterators.UserdefFuncCall
All Implemented Interfaces:
XDMIterator, Traversable

public class UserdefFuncCall
extends CurrentBasedIterator


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
UserdefFuncCall(Context ctx, QName fName, QName[] paramNames, TypeInfo[] paramTypes, XDMIterator function, TypeInfo returnType, XDMIterator returnSeqTypeIt, int exprCategory, QueryLocation location)
           
 
Method Summary
 XDMIterator copy(Context parentIterContext, XQStaticContext newParentIterContext, boolean copyContext, java.util.Vector nestedPredCtxStack)
          Copies the Iterator.
 XDMIterator[] getAllSubIters()
           
 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
 int getExprTypeShallow()
           
 QName getFunctionName()
           
 PendingUpdateList getPendingUpdateList()
          Returns the complete Pending Update List (PUL) of this iterator.
 TypeInfo getStaticType()
          Return the return type if it can be statically determined
 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 setResettable(boolean r)
          Set this Iterator (and its subiterators) resetable.
 void setSubIters(XDMIterator[] subIt)
           
 
Methods inherited from class ch.ethz.mxquery.model.Iterator
addPredicates, close, copyInts, copyIterators, copyQNames, copyStrings, copyTypeInfos, getAllSubItersRecursive, getContext, getLoc, getPredicates, getSubIters, hasPredicates, isConstModePreserve, isExprParameter, isOpen, isResettable, removePredicates, reset, setConstModePreserve, setLoc, setOrderByExpr, setParam, setReturnExpr, setSubIters, setSubIters, setWhereExpr, traverse, traverseIteratorTree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserdefFuncCall

public UserdefFuncCall(Context ctx,
                       QName fName,
                       QName[] paramNames,
                       TypeInfo[] paramTypes,
                       XDMIterator function,
                       TypeInfo returnType,
                       XDMIterator returnSeqTypeIt,
                       int exprCategory,
                       QueryLocation location)
                throws MXQueryException
Throws:
MXQueryException
Method Detail

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

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

setSubIters

public void setSubIters(XDMIterator[] subIt)
                 throws MXQueryException
Specified by:
setSubIters in interface XDMIterator
Overrides:
setSubIters in class Iterator
Throws:
MXQueryException

getPendingUpdateList

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

Specified by:
getPendingUpdateList in interface XDMIterator
Overrides:
getPendingUpdateList in class Iterator
Returns:
pending update list
Throws:
MXQueryException

copy

public final 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

getExprTypeShallow

public int getExprTypeShallow()
                       throws MXQueryException
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*

getFunctionName

public QName getFunctionName()

getAllSubIters

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

getExpressionCategoryType

public int getExpressionCategoryType(boolean scripting)
                              throws MXQueryException
Description copied from interface: XDMIterator
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

Specified by:
getExpressionCategoryType in interface XDMIterator
Overrides:
getExpressionCategoryType in class Iterator
Parameters:
scripting - TODO
Returns:
the most stringent expression type
Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich