|
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 Streampublic TokenBufferStore(int id, WindowBuffer container)
Method Detail |
---|
public void start()
ActiveStore
public void setIterator(XDMIterator it)
StreamStore
setIterator
in interface StreamStore
setIterator
in class FIFOStore
public void setContext(Context context) throws MXQueryException
setContext
in interface MXQueryAppendUpdate
setContext
in class FIFOStore
context
-
MXQueryException
public int getTokenIdForNode(int nodeId) throws MXQueryException
getTokenIdForNode
in interface MXQueryAppendUpdate
getTokenIdForNode
in class FIFOStore
nodeId
-
MXQueryException
public boolean hasNode(int node) throws MXQueryException
hasNode
in interface MXQueryAppendUpdate
hasNode
in class FIFOStore
node
- 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 MXQueryAppendUpdate
getNodeIdFromTokenId
in class FIFOStore
minNodeId
- tokenId
-
MXQueryException
public void printBuffer()
public Token get(int tokenId) throws MXQueryException
get
in interface StreamStore
get
in interface MXQueryAppendUpdate
get
in class FIFOStore
tokenId
-
MXQueryException
public Token get(int tokenId, int maxNodeId) throws MXQueryException
get
in interface MXQueryAppendUpdate
get
in class FIFOStore
tokenId
- Token IdmaxNodeId
- Max Token Id
MXQueryException
public int getMaxNodeId()
public int getMaxTokenId()
public int getSize()
getSize
in class FIFOStore
public void deleteItems(int olderThanItemId) throws MXQueryException
deleteItems
in interface AppendUpdate
deleteItems
in class FIFOStore
olderThanItemId
-
MXQueryException
public int getAttributePosFromTokenId(java.lang.String attrName, int activeTokenId) throws MXQueryException
getAttributePosFromTokenId
in class FIFOStore
MXQueryException
public int getAttributePosFromNodeId(java.lang.String attrName, int nodeId) throws MXQueryException
getAttributePosFromNodeId
in class FIFOStore
MXQueryException
public int getMyId()
StreamStore
getMyId
in interface StreamStore
getMyId
in class FIFOStore
public void buffer(Token tok, int event)
StreamStore
buffer
in interface StreamStore
buffer
in class FIFOStore
public void newItem()
StreamStore
newItem
in interface StreamStore
newItem
in class FIFOStore
public int compare(Source store)
compare
in interface Source
compare
in class FIFOStore
public Source copySource(Context ctx, java.util.Vector nestedPredCtxStack) throws MXQueryException
copySource
in interface Source
copySource
in class FIFOStore
MXQueryException
public java.lang.String getURI()
Source
getURI
in interface Source
getURI
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 |