|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.tinyos.tinydb.TinyDBQuery
TinyDBQuery is a Java data structure representing a query running (or to be run) on a set of motes. Queries consist of: - a list of fields to select - a list of expressions over those fields, where an expression is - an filter that rejects some readings - an aggregate that combines local readings with readings from neighbors. In addition to allowing a query to be built, this class includes methods to generate radio messages so the query can be distributed over the network or to abort the query
Field Summary | |
short |
epochDur
|
byte |
from_qid
|
static short |
kEPOCH_DUR_ONE_SHOT
|
static byte |
NO_FROM_QUERY
|
byte |
qid
|
Constructor Summary | |
TinyDBQuery(byte qid,
short epochDur)
Constructor |
Method Summary | |
net.tinyos.message.Message |
abortMessage()
Return a byte array representing a radio message that will tell motes to abort this query |
boolean |
active()
|
void |
addExpr(net.tinyos.tinydb.QueryExpr e)
Add the specified expression to the query |
void |
addField(net.tinyos.tinydb.QueryField f)
Add the specified field to the query |
boolean |
containsNonAggFields()
Returns true iff the query contains a field that isn't contained in any aggregate. |
java.util.Vector |
getColumnHeadings()
|
net.tinyos.tinydb.QueryExpr |
getExpr(int i)
|
net.tinyos.tinydb.QueryField |
getField(int i)
Return the ith field in this query |
byte |
getFieldType(int idx)
|
byte |
getFromQid()
|
net.tinyos.tinydb.AggExpr |
getGroupExpr()
|
int |
getId()
Return the id of the query |
java.lang.String |
getSQL()
Return the text of the SQL for this query as set by setSQL (Note that TinyDBQuery does not include an interface for generating SQL from an arbitrary query.) |
java.lang.String |
groupColName()
Return the name of the group by column |
boolean |
grouped()
Return true if the query is grouped (e.g. |
boolean |
hasOutputAction()
|
boolean |
isAgg()
Return true if this query contains one or more aggregate expressions |
java.util.Iterator |
messageIterator()
Return an Iterator over messages to be sent to start sensors running this query |
int |
numExprs()
|
int |
numFields()
Return the number of fields in this query |
void |
setActive(boolean active)
|
void |
setEpoch(short epochDur)
|
void |
setFromQid(byte qid)
Set the id of the query this query reads results from |
void |
setGrouped(boolean isGrouped)
|
void |
setGroupExpr(net.tinyos.tinydb.AggExpr ae)
|
void |
setId(byte qid)
|
void |
setOutputCommand(java.lang.String cmd)
|
void |
setOutputCommand(java.lang.String cmd,
short param)
|
void |
setSQL(java.lang.String s)
Set the SQL string associated with this query. |
java.lang.String |
toString()
|
void |
useRamBuffer(short size)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public byte qid
public byte from_qid
public short epochDur
public static final byte NO_FROM_QUERY
public static final short kEPOCH_DUR_ONE_SHOT
Constructor Detail |
public TinyDBQuery(byte qid, short epochDur)
qid
- The id of the queryepochDur
- The rate at which results from the query should be generatedMethod Detail |
public int getId()
public void setId(byte qid)
public void setEpoch(short epochDur)
public void addField(net.tinyos.tinydb.QueryField f)
public void addExpr(net.tinyos.tinydb.QueryExpr e)
public boolean grouped()
public void setGrouped(boolean isGrouped)
public void setGroupExpr(net.tinyos.tinydb.AggExpr ae)
public net.tinyos.tinydb.AggExpr getGroupExpr()
public java.lang.String groupColName()
public java.lang.String getSQL()
public void setSQL(java.lang.String s)
public boolean isAgg()
public int numExprs()
public net.tinyos.tinydb.QueryExpr getExpr(int i) throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean containsNonAggFields()
public void setOutputCommand(java.lang.String cmd, short param)
public void setOutputCommand(java.lang.String cmd)
public boolean hasOutputAction()
public int numFields()
public net.tinyos.tinydb.QueryField getField(int i) throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
- if i < 0 or i >= numFields()public net.tinyos.message.Message abortMessage()
public java.util.Vector getColumnHeadings()
public byte getFieldType(int idx) throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
public java.util.Iterator messageIterator()
public byte getFromQid()
public void setFromQid(byte qid)
public void useRamBuffer(short size)
public boolean active()
public void setActive(boolean active)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |