moteaccess
Class MoteReaction

java.lang.Object
  extended bymoteaccess.MoteReaction
Direct Known Subclasses:
LimeMoteReaction

public class MoteReaction
extends java.lang.Object

This class carries the information regarding a reaction that are passed to the IMoteAccess in order to register a reaction.

Version:
1.0
Author:
Carlo Curino, Matteo Giani, Marco Giorgetta, Alessandro Giusti

Field Summary
protected  Condition cond
          The condition of the reaction.
protected  MoteID mid
          The mote id.
protected  java.lang.Boolean persistentMode
          This value is true when the reaction is not deregistered after the first firing; false if the reaction keeps on returning data and is not deregistered after the first firing.
protected  SensorType st
          The type of the sensor.
 
Constructor Summary
MoteReaction(MoteID m, SensorType st, Condition c, boolean persistent)
          Public constructor of a mote reaction.
MoteReaction(MoteID m, SensorType sensorType, Condition cond, java.lang.Boolean persistentMode)
          Public constructor of a mote reaction.
MoteReaction(MoteReaction mr2)
          Copy constructor.
 
Method Summary
 Condition getCondition()
          Getter for the condition.
 MoteID getMoteID()
          Return the required MoteID
 SensorType getSensorType()
          Return the desired sensor
 boolean isOnce()
          True if the reaction is "one-shot".
 boolean isPersistent()
          True if the reaction is persistent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mid

protected MoteID mid
The mote id.


st

protected SensorType st
The type of the sensor.


persistentMode

protected java.lang.Boolean persistentMode
This value is true when the reaction is not deregistered after the first firing; false if the reaction keeps on returning data and is not deregistered after the first firing.


cond

protected Condition cond
The condition of the reaction.

Constructor Detail

MoteReaction

public MoteReaction(MoteID m,
                    SensorType sensorType,
                    Condition cond,
                    java.lang.Boolean persistentMode)
Public constructor of a mote reaction.

Parameters:
m - the mote id.
sensorType - the sensor type.
cond - the condition of the reaction.
persistentMode - true for persistent mode (lime's once per tuple).

MoteReaction

public MoteReaction(MoteID m,
                    SensorType st,
                    Condition c,
                    boolean persistent)
Public constructor of a mote reaction.

Parameters:
m - the mote id.
st - the sensor type.
c - the condition
persistent - true for persistent mode.

MoteReaction

public MoteReaction(MoteReaction mr2)
Copy constructor.

Method Detail

getMoteID

public MoteID getMoteID()
Return the required MoteID


isOnce

public boolean isOnce()
True if the reaction is "one-shot".


isPersistent

public boolean isPersistent()
True if the reaction is persistent.


getSensorType

public SensorType getSensorType()
Return the desired sensor


getCondition

public Condition getCondition()
Getter for the condition.

Returns:
the condition of the reaction.