MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.bindings
Class WindowSequenceIterator

java.lang.Object
  extended by ch.ethz.mxquery.model.Iterator
      extended by ch.ethz.mxquery.model.Window
          extended by ch.ethz.mxquery.bindings.WindowIterator
              extended by ch.ethz.mxquery.bindings.WindowSequenceIterator
All Implemented Interfaces:
IndexIterator, XDMIterator, Traversable

public final class WindowSequenceIterator
extends WindowIterator

Window Iterators are only created by a WindowBuffer or by a existing WindowIterator. All window iterators operate on window buffer and have a defined range on this buffer.
Important definitions:
item: Is a item in a sequence
position: Position as in XQuery. First position is 1.
nodeId: Like Position but starting with 0
tokenId: Id of each token. Also starting with 0


Field Summary
 
Fields inherited from class ch.ethz.mxquery.model.Window
END_OF_STREAM_NODE, END_OF_STREAM_POSITION
 
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
 
Method Summary
 java.lang.String getAttributeType(int i)
           
 Identifier getId()
           
 XDMIterator getItem(int position)
          Returns the item on the given Position.
 WindowBuffer getMat()
           
 Window getNewEarlyParallelWindowInterface(int startPosition, WindowVariable[] startVars, VariableHolder[] startVarHolders, XDMIterator endExpr, WindowVariable[] endVars, VariableHolder[] endVarHolders)
           
 Window getNewEarlyWindowInterface(int startPosition, XDMIterator startExpr, WindowVariable[] startVars, VariableHolder[] startVarHolders, XDMIterator endExpr, WindowVariable[] endVars, VariableHolder[] endVarHolders)
           
 Window getNewItemWindow(IntegerList values)
          Returns a new iterator consisting of the given items in the integer list.
 Window getNewWindow(int startPosition, int endPosition)
          Returns a new window inside this window.
 int getPosition()
           
 int getStartNode()
          Returns the first node id of the window
 boolean hasItem(int position)
          Checks if the given position is availabe
 boolean hasNextItem()
          Checks if a next item exists.
 boolean isAttributeDefault(int i)
           
 Token next()
          xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Iterator standard methods xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 XDMIterator nextItem()
          Returns the next item if exist
 
Methods inherited from class ch.ethz.mxquery.bindings.WindowIterator
destroyWindow, equals, getStore, getWindowId, hashCode, isWindowInUse, setContext, setWindowInUse
 
Methods inherited from class ch.ethz.mxquery.model.Window
getEndPosition, getNextWindowStartPosition, getUnderlyingWindow, increasePosition, isExprParameter, isWindow, jumpToNextAttribute, setPosition
 
Methods inherited from class ch.ethz.mxquery.model.Iterator
addPredicates, close, copy, copyInts, copyIterators, copyQNames, copyStrings, copyTypeInfos, getAllSubIters, getAllSubItersRecursive, getContext, getExpressionCategoryType, getLoc, getPendingUpdateList, getPredicates, getStaticType, getSubIters, hasPredicates, isConstModePreserve, isOpen, isResettable, removePredicates, reset, setConstModePreserve, setContext, setLoc, setOrderByExpr, setParam, setResettable, setReturnExpr, setSubIters, setSubIters, setSubIters, setWhereExpr, traverse, traverseIteratorTree
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hasItem

public boolean hasItem(int position)
                throws MXQueryException
Description copied from interface: IndexIterator
Checks if the given position is availabe

Parameters:
position - Position in the sequence (starting with 1)
Returns:
True if the next item is not end_sequence otherwise false
Throws:
MXQueryException

hasNextItem

public boolean hasNextItem()
                    throws MXQueryException
Checks if a next item exists. Especially used in for's or forseq's

Returns:
true if the next items exists
Throws:
MXQueryException

nextItem

public XDMIterator nextItem()
                     throws MXQueryException
Returns the next item if exist

Returns:
an iterator representing the next item, if it exists, otherwise an empty sequence iterator
Throws:
MXQueryException

getNewWindow

public Window getNewWindow(int startPosition,
                           int endPosition)
Returns a new window inside this window. Technically this window operates on the underlying buffer directly but it inherits the border of the current window

Specified by:
getNewWindow in class Window
Parameters:
startPosition - start position inside the current window
endPosition - end position inside the current window
Returns:
new window iterator

getNewEarlyWindowInterface

public Window getNewEarlyWindowInterface(int startPosition,
                                         XDMIterator startExpr,
                                         WindowVariable[] startVars,
                                         VariableHolder[] startVarHolders,
                                         XDMIterator endExpr,
                                         WindowVariable[] endVars,
                                         VariableHolder[] endVarHolders)
Overrides:
getNewEarlyWindowInterface in class Window

getNewEarlyParallelWindowInterface

public Window getNewEarlyParallelWindowInterface(int startPosition,
                                                 WindowVariable[] startVars,
                                                 VariableHolder[] startVarHolders,
                                                 XDMIterator endExpr,
                                                 WindowVariable[] endVars,
                                                 VariableHolder[] endVarHolders)
Overrides:
getNewEarlyParallelWindowInterface in class Window

getNewItemWindow

public Window getNewItemWindow(IntegerList values)
Description copied from class: Window
Returns a new iterator consisting of the given items in the integer list. If a position is outside the underlying sequence, the position is skipped.

Specified by:
getNewItemWindow in class Window
Parameters:
values - Each value in the integer list has to be a position
Returns:
a new Window for the given list of positions

next

public Token next()
           throws MXQueryException
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Iterator standard methods xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Returns:
The XDM token representing the next fragment of the XDM instance
Throws:
MXQueryException

getPosition

public int getPosition()
Specified by:
getPosition in class Window

getStartNode

public int getStartNode()
Description copied from class: Window
Returns the first node id of the window

Specified by:
getStartNode in class WindowIterator
Returns:
returns the first node id of this window

getItem

public XDMIterator getItem(int position)
                    throws MXQueryException
Description copied from interface: IndexIterator
Returns the item on the given Position. If the item is not evailabe, an empty sequence item is returned

Parameters:
position - Position in the sequence (starting with 1)
Returns:
Item or empty sequence iterator
Throws:
MXQueryException

getMat

public WindowBuffer getMat()

getAttributeType

public java.lang.String getAttributeType(int i)

isAttributeDefault

public boolean isAttributeDefault(int i)

getId

public Identifier getId()

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich