|
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 XDMIteratorcontext - the context to assignrecursive - true perform the assignment also subiteratos, false only replace on the current iterator
MXQueryExceptionpublic void setSubIters(java.util.Vector subIt)
public void setSubIters(XDMIterator[] subIt)
throws MXQueryException
setSubIters in interface XDMIteratorMXQueryExceptionpublic void setSubIters(XDMIterator subIt)
setSubIters in interface XDMIterator
public XDMIterator[] getSubIters()
throws MXQueryException
getSubIters in interface XDMIteratorMXQueryExceptionpublic 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
MXQueryExceptionpublic Context getContext()
XDMIterator
getContext in interface XDMIterator
public void setResettable(boolean r)
throws MXQueryException
XDMIterator
setResettable in interface XDMIteratorr - true make this iterator resetable, false make it not resetable
MXQueryException
public boolean isResettable()
throws MXQueryException
XDMIterator
isResettable in interface XDMIteratorMXQueryException
public boolean isExprParameter(int valueToCheck,
boolean recursive)
XDMIterator
isExprParameter in interface XDMIterator
public final void reset()
throws MXQueryException
XDMIterator
reset in interface XDMIteratorMXQueryException
public final void close(boolean restartable)
throws MXQueryException
XDMIterator
close in interface XDMIteratorrestartable - make the iterator restartable (otherwise the iterator will stay closed with additional next calls)
MXQueryExceptionpublic TypeInfo getStaticType()
XDMIterator
getStaticType in interface XDMIterator
public int getExpressionCategoryType(boolean scripting)
throws MXQueryException
XDMIterator
getExpressionCategoryType in interface XDMIteratorscripting - TODO
MXQueryExceptionpublic XDMIterator[] getAllSubIters()
getAllSubIters in interface XDMIteratorpublic java.util.Vector getAllSubItersRecursive()
getAllSubItersRecursive in interface XDMIterator
public KXmlSerializer traverseIteratorTree(KXmlSerializer serializer)
throws java.lang.Exception
traverseIteratorTree in interface XDMIteratorjava.lang.Exceptionpublic KXmlSerializer traverse(KXmlSerializer serializer)
traverse in interface Traversablepublic boolean isOpen()
isOpen in interface XDMIterator
public PendingUpdateList getPendingUpdateList()
throws MXQueryException
XDMIteratornull 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 XDMIteratorMXQueryException
public XDMIterator copy(Context parentIterContext,
XQStaticContext prevParentIterContext,
boolean copyContext,
java.util.Vector nestedPredCtxStack)
throws MXQueryException
XDMIterator
copy in interface XDMIteratorparentIterContext - 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
MXQueryExceptionpublic 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 XDMIteratorpublic void setLoc(QueryLocation loc)
XDMIterator
setLoc in interface XDMIteratorloc - the QueryLocation object representing the locationpublic boolean isConstModePreserve()
isConstModePreserve in interface XDMIteratorpublic 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 | ||||||||