|
MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.ethz.mxquery.model.Iterator
public abstract class Iterator
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 | |
---|---|
Iterator(Context ctx,
int minExpected,
XDMIterator[] subIters,
QueryLocation location)
|
|
Iterator(Context ctx,
QueryLocation location)
|
|
Iterator(Context ctx,
XDMIterator[] subIters,
int expected,
QueryLocation location)
|
|
Iterator(Context ctx,
XDMIterator[] subIters,
QueryLocation location)
|
Method Summary | |
---|---|
void |
addPredicates(Iterator[] predIters)
|
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. |
static int[] |
copyInts(int[] ints)
|
static XDMIterator[] |
copyIterators(Context context,
XDMIterator[] iters,
java.util.Vector nestedPredCtxStack)
|
static QName[] |
copyQNames(QName[] qnames)
|
static java.lang.String[] |
copyStrings(java.lang.String[] strings)
|
static TypeInfo[] |
copyTypeInfos(TypeInfo[] infos)
|
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. |
Iterator[] |
getPredicates()
|
TypeInfo |
getStaticType()
Return the return type if it can be statically determined |
XDMIterator[] |
getSubIters()
|
boolean |
hasPredicates()
|
boolean |
isConstModePreserve()
|
boolean |
isExprParameter(int valueToCheck,
boolean recursive)
Optimization check |
boolean |
isOpen()
|
boolean |
isResettable()
Retrieve if this iterator is resetable |
void |
removePredicates()
|
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 |
setOrderByExpr(XDMIterator orderByExpr)
|
void |
setParam(java.lang.String name,
java.lang.String value)
|
void |
setResettable(boolean r)
Set this Iterator (and its subiterators) resetable. |
void |
setReturnExpr(XDMIterator retExpr)
|
void |
setSubIters(java.util.Vector subIt)
|
void |
setSubIters(XDMIterator subIt)
|
void |
setSubIters(XDMIterator[] subIt)
|
void |
setWhereExpr(XDMIterator whereExpr)
|
KXmlSerializer |
traverse(KXmlSerializer serializer)
|
KXmlSerializer |
traverseIteratorTree(KXmlSerializer serializer)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface ch.ethz.mxquery.model.XDMIterator |
---|
next |
Constructor Detail |
---|
public Iterator(Context ctx, QueryLocation location)
public Iterator(Context ctx, int minExpected, XDMIterator[] subIters, QueryLocation location) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Iterator(Context ctx, XDMIterator[] subIters, int expected, QueryLocation location) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public Iterator(Context ctx, XDMIterator[] subIters, QueryLocation location)
Method Detail |
---|
public void addPredicates(Iterator[] predIters)
public Iterator[] getPredicates()
public void removePredicates()
public boolean hasPredicates()
public void setContext(Context context, boolean recursive) throws MXQueryException
XDMIterator
setContext
in interface XDMIterator
context
- the context to assignrecursive
- true perform the assignment also subiteratos, false only replace on the current iterator
MXQueryException
public void setSubIters(java.util.Vector subIt)
public void setSubIters(XDMIterator[] subIt) throws MXQueryException
setSubIters
in interface XDMIterator
MXQueryException
public void setSubIters(XDMIterator subIt)
setSubIters
in interface XDMIterator
public XDMIterator[] getSubIters() throws MXQueryException
getSubIters
in interface XDMIterator
MXQueryException
public void setReturnExpr(XDMIterator retExpr)
public void setOrderByExpr(XDMIterator orderByExpr)
public void setWhereExpr(XDMIterator whereExpr)
public void setParam(java.lang.String name, java.lang.String value) throws MXQueryException
MXQueryException
public Context getContext()
XDMIterator
getContext
in interface XDMIterator
public void setResettable(boolean r) throws MXQueryException
XDMIterator
setResettable
in interface XDMIterator
r
- true make this iterator resetable, false make it not resetable
MXQueryException
public boolean isResettable() throws MXQueryException
XDMIterator
isResettable
in interface XDMIterator
MXQueryException
public boolean isExprParameter(int valueToCheck, boolean recursive)
XDMIterator
isExprParameter
in interface XDMIterator
public final void reset() throws MXQueryException
XDMIterator
reset
in interface XDMIterator
MXQueryException
public final void close(boolean restartable) throws MXQueryException
XDMIterator
close
in interface XDMIterator
restartable
- make the iterator restartable (otherwise the iterator will stay closed with additional next calls)
MXQueryException
public TypeInfo getStaticType()
XDMIterator
getStaticType
in interface XDMIterator
public int getExpressionCategoryType(boolean scripting) throws MXQueryException
XDMIterator
getExpressionCategoryType
in interface XDMIterator
scripting
- TODO
MXQueryException
public XDMIterator[] getAllSubIters()
getAllSubIters
in interface XDMIterator
public java.util.Vector getAllSubItersRecursive()
getAllSubItersRecursive
in interface XDMIterator
public KXmlSerializer traverseIteratorTree(KXmlSerializer serializer) throws java.lang.Exception
traverseIteratorTree
in interface XDMIterator
java.lang.Exception
public KXmlSerializer traverse(KXmlSerializer serializer)
traverse
in interface Traversable
public boolean isOpen()
isOpen
in interface XDMIterator
public PendingUpdateList getPendingUpdateList() throws MXQueryException
XDMIterator
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
getPendingUpdateList
in interface XDMIterator
MXQueryException
public XDMIterator copy(Context parentIterContext, XQStaticContext prevParentIterContext, boolean copyContext, java.util.Vector nestedPredCtxStack) throws MXQueryException
XDMIterator
copy
in interface XDMIterator
parentIterContext
- The new parent contextprevParentIterContext
- The previous context of the parent iteratorcopyContext
- Copy the context or use the parent contextnestedPredCtxStack
- The Stack of nested predicate context, needed for nested rewritten predicates
MXQueryException
public static XDMIterator[] copyIterators(Context context, XDMIterator[] iters, java.util.Vector nestedPredCtxStack) throws MXQueryException
MXQueryException
public static java.lang.String[] copyStrings(java.lang.String[] strings)
public static int[] copyInts(int[] ints)
public static TypeInfo[] copyTypeInfos(TypeInfo[] infos)
public static QName[] copyQNames(QName[] qnames)
public QueryLocation getLoc()
XDMIterator
getLoc
in interface XDMIterator
public void setLoc(QueryLocation loc)
XDMIterator
setLoc
in interface XDMIterator
loc
- the QueryLocation object representing the locationpublic boolean isConstModePreserve()
isConstModePreserve
in interface XDMIterator
public void setConstModePreserve(boolean constModePreserve)
setConstModePreserve
in interface XDMIterator
|
MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |