|
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.sms.MMimpl.FIFOStore
ch.ethz.mxquery.sms.MMimpl.TokenBufferStore
public class TokenBufferStore
Simple TokenBuffer to materialize a stream. Additional a index on the node id's is created to allow easy jumping between nodes.
| Field Summary | |
|---|---|
int |
level
|
static int |
MAX_NODE_ID
|
int |
myId
|
Token[] |
tokenBuffer
|
| Fields inherited from class ch.ethz.mxquery.sms.MMimpl.FIFOStore |
|---|
iterator, readThread |
| Constructor Summary | |
|---|---|
TokenBufferStore(int id,
WindowBuffer container)
|
|
TokenBufferStore(XDMIterator sourceStream,
int id,
WindowBuffer container)
Creates a new TokenBuffer for a stream with standard paras |
|
| Method Summary | |
|---|---|
void |
buffer(Token tok,
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 olderThanItemId)
Simple garbage collection; deletes all nodes that are older than the parameter |
Token |
get(int tokenId)
Returns the Token for a given token id |
Token |
get(int tokenId,
int maxNodeId)
Returns the token for a given tokenId. |
int |
getAttributePosFromNodeId(java.lang.String attrName,
int nodeId)
|
int |
getAttributePosFromTokenId(java.lang.String attrName,
int activeTokenId)
|
int |
getMaxNodeId()
Returns the current materialized nodeId |
int |
getMaxTokenId()
Returns the current materialized tokenId |
int |
getMyId()
Returns the store id (mostly for debugging) |
int |
getNodeIdFromTokenId(int tokenId)
Returns the NodeId for the given Token Id; The first node has the id = 0. |
int |
getNodeIdFromTokenId(int minNodeId,
int tokenId)
Like getNodeIdFromPosition(int position) but we give a additional information that makes the search for the right nodeId faster. |
int |
getSize()
|
int |
getTokenIdForNode(int nodeId)
Returns the position for a given NodePosition. |
java.lang.String |
getURI()
Returns the URI of the source. |
boolean |
hasNode(int node)
Checks if a node exists |
void |
newItem()
Specify the beginning of a new item |
void |
printBuffer()
|
void |
setContext(Context context)
Sets the context of the source stream. |
void |
setIterator(XDMIterator it)
For pull stores, add the iterator from which they should pull their data |
void |
start()
Start the gathering of the active store |
| Methods inherited from class ch.ethz.mxquery.sms.MMimpl.FIFOStore |
|---|
getCurrentTokenId, getIterator, setContainer |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MAX_NODE_ID
public int level
public Token[] tokenBuffer
public int myId
| Constructor Detail |
|---|
public TokenBufferStore(XDMIterator sourceStream,
int id,
WindowBuffer container)
sourceStream - Source Stream
public TokenBufferStore(int id,
WindowBuffer container)
| Method Detail |
|---|
public void start()
ActiveStore
public void setIterator(XDMIterator it)
StreamStore
setIterator in interface StreamStoresetIterator in class FIFOStore
public void setContext(Context context)
throws MXQueryException
setContext in interface MXQueryAppendUpdatesetContext in class FIFOStorecontext -
MXQueryException
public int getTokenIdForNode(int nodeId)
throws MXQueryException
getTokenIdForNode in interface MXQueryAppendUpdategetTokenIdForNode in class FIFOStorenodeId -
MXQueryException
public boolean hasNode(int node)
throws MXQueryException
hasNode in interface MXQueryAppendUpdatehasNode in class FIFOStorenode - a node id
MXQueryException
public int getNodeIdFromTokenId(int tokenId)
throws MXQueryException
tokenId -
MXQueryException
public int getNodeIdFromTokenId(int minNodeId,
int tokenId)
throws MXQueryException
getNodeIdFromTokenId in interface MXQueryAppendUpdategetNodeIdFromTokenId in class FIFOStoreminNodeId - tokenId -
MXQueryExceptionpublic void printBuffer()
public Token get(int tokenId)
throws MXQueryException
get in interface StreamStoreget in interface MXQueryAppendUpdateget in class FIFOStoretokenId -
MXQueryException
public Token get(int tokenId,
int maxNodeId)
throws MXQueryException
get in interface MXQueryAppendUpdateget in class FIFOStoretokenId - Token IdmaxNodeId - Max Token Id
MXQueryExceptionpublic int getMaxNodeId()
public int getMaxTokenId()
public int getSize()
getSize in class FIFOStore
public void deleteItems(int olderThanItemId)
throws MXQueryException
deleteItems in interface AppendUpdatedeleteItems in class FIFOStoreolderThanItemId -
MXQueryException
public int getAttributePosFromTokenId(java.lang.String attrName,
int activeTokenId)
throws MXQueryException
getAttributePosFromTokenId in class FIFOStoreMXQueryException
public int getAttributePosFromNodeId(java.lang.String attrName,
int nodeId)
throws MXQueryException
getAttributePosFromNodeId in class FIFOStoreMXQueryExceptionpublic int getMyId()
StreamStore
getMyId in interface StreamStoregetMyId in class FIFOStore
public void buffer(Token tok,
int event)
StreamStore
buffer in interface StreamStorebuffer in class FIFOStorepublic void newItem()
StreamStore
newItem in interface StreamStorenewItem in class FIFOStorepublic int compare(Source store)
compare in interface Sourcecompare in class FIFOStore
public Source copySource(Context ctx,
java.util.Vector nestedPredCtxStack)
throws MXQueryException
copySource in interface SourcecopySource in class FIFOStoreMXQueryExceptionpublic java.lang.String getURI()
Source
getURI in interface SourcegetURI in class FIFOStore
|
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 | ||||||||