MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.sms.MMimpl
Class LazyFIFOStore

java.lang.Object
  extended by ch.ethz.mxquery.sms.MMimpl.LazyFIFOStore
All Implemented Interfaces:
Source, AppendUpdate, StreamStore, MXQueryAppendUpdate
Direct Known Subclasses:
LazyRandomFIFOStore, LazySequentialFIFOStore

public abstract class LazyFIFOStore
extends java.lang.Object
implements MXQueryAppendUpdate


Method Summary
 void buffer(Token token, int event)
          Materialize the given token into the store instance
 int compare(Source store)
           
 Source copySource(Context ctx, java.util.Vector nestedPredCtxStack)
           
 void deleteItems(int nodeId)
          Mark as consumed all items up to lastItemId
abstract  void freeBuffers()
           
 Token get(int activeTokenId)
          Get Token at given position
 Token get(int activeTokenId, int endNode)
           
 int getAttributePosFromNodeId(java.lang.String attrName, int nodeId)
           
 int getAttributePosFromTokenId(java.lang.String attrName, int activeTokenId)
           
 int getCurrentTokenId()
           
 Window getIterator(Context ctx)
          Returns Iterator that points on the first token in the store.
 int getMyId()
          Returns the store id (mostly for debugging)
 int getNodeIdFromTokenId(int lastKnownNodeId, int activeTokenId)
           
 int getSize()
           
 int getTokenIdForNode(int nodeId)
           
 java.lang.String getURI()
          Returns the URI of the source.
 boolean hasNode(int nodeId)
           
 void newItem()
          Specify the beginning of a new item
 void readToken()
           
 void setContainer(WindowBuffer buf)
           
 void setContext(Context context)
           
 void setContext(XQStaticContext context)
           
 void setIterator(XDMIterator it)
          For pull stores, add the iterator from which they should pull their data
abstract  void start()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getMyId

public int getMyId()
Description copied from interface: StreamStore
Returns the store id (mostly for debugging)

Specified by:
getMyId in interface StreamStore
Returns:
id of the store given at creation time

freeBuffers

public abstract void freeBuffers()

start

public abstract void start()

setIterator

public void setIterator(XDMIterator it)
Description copied from interface: StreamStore
For pull stores, add the iterator from which they should pull their data

Specified by:
setIterator in interface StreamStore

setContext

public void setContext(XQStaticContext context)

readToken

public void readToken()

get

public Token get(int activeTokenId)
Description copied from interface: StreamStore
Get Token at given position

Specified by:
get in interface StreamStore
Specified by:
get in interface MXQueryAppendUpdate
Parameters:
activeTokenId - Unique id given to the token inside this store instance (token position
Returns:
the Token at the given position

get

public Token get(int activeTokenId,
                 int endNode)
Specified by:
get in interface MXQueryAppendUpdate

getNodeIdFromTokenId

public int getNodeIdFromTokenId(int lastKnownNodeId,
                                int activeTokenId)
Specified by:
getNodeIdFromTokenId in interface MXQueryAppendUpdate

hasNode

public boolean hasNode(int nodeId)
Specified by:
hasNode in interface MXQueryAppendUpdate

getTokenIdForNode

public int getTokenIdForNode(int nodeId)
                      throws MXQueryException
Specified by:
getTokenIdForNode in interface MXQueryAppendUpdate
Throws:
MXQueryException

deleteItems

public void deleteItems(int nodeId)
Description copied from interface: AppendUpdate
Mark as consumed all items up to lastItemId

Specified by:
deleteItems in interface AppendUpdate
Parameters:
nodeId - Id of the item that was consumed last

getSize

public int getSize()

newItem

public void newItem()
Description copied from interface: StreamStore
Specify the beginning of a new item

Specified by:
newItem in interface StreamStore

buffer

public void buffer(Token token,
                   int event)
            throws MXQueryException
Description copied from interface: StreamStore
Materialize the given token into the store instance

Specified by:
buffer in interface StreamStore
Throws:
MXQueryException

getAttributePosFromNodeId

public int getAttributePosFromNodeId(java.lang.String attrName,
                                     int nodeId)
                              throws MXQueryException
Throws:
MXQueryException

getAttributePosFromTokenId

public int getAttributePosFromTokenId(java.lang.String attrName,
                                      int activeTokenId)

getCurrentTokenId

public int getCurrentTokenId()

getIterator

public Window getIterator(Context ctx)
                   throws MXQueryException
Description copied from interface: Source
Returns Iterator that points on the first token in the store.

Specified by:
getIterator in interface Source
Returns:
Iterator a (Window) Iterator to access the contents of this source
Throws:
MXQueryException

compare

public int compare(Source store)
Specified by:
compare in interface Source

copySource

public Source copySource(Context ctx,
                         java.util.Vector nestedPredCtxStack)
                  throws MXQueryException
Specified by:
copySource in interface Source
Throws:
MXQueryException

getURI

public java.lang.String getURI()
Description copied from interface: Source
Returns the URI of the source.

Specified by:
getURI in interface Source
Returns:
a String representing the URI/Identifier of this source

setContainer

public void setContainer(WindowBuffer buf)
Specified by:
setContainer in interface MXQueryAppendUpdate

setContext

public void setContext(Context context)
                throws MXQueryException
Specified by:
setContext in interface MXQueryAppendUpdate
Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich