View Javadoc

1   package cz.cuni.amis.pogamut.usar2004.agent.module.response;
2   
3   import cz.cuni.amis.pogamut.usar2004.agent.module.datatypes.ResponseType;
4   
5   /**
6    * response message recieved after SET {Type Sensor} or SET {Type Effector}
7    * command where Sensor and Effector are names of robots device.
8    *
9    * @author vejmanm
10   */
11  public class ResponseSensorEffecter extends SuperResponse
12  {
13      public static final ResponseType type = ResponseType.SENSOR_EFFECTER;
14  
15      /**
16       * Ctor. Response type describes particular subject about which we want to
17       * know about. It is used to distinguish incoming message from the server.
18       */
19      public ResponseSensorEffecter()
20      {
21          super(type);
22      }
23  
24      /**
25       * Returns name of the sensor or effecter.
26       *
27       * @return Returns name of the sensor or effecter.
28       */
29      public String getName()
30      {
31          return lastMessage.getNames().get(0);
32      }
33  
34      /**
35       *
36       * Returns status of the sensor or effecter operation.
37       *
38       * @return Returns status of the sensor or effecter operation.
39       */
40      public String getStatus()
41      {
42          return lastMessage.getStatuses().get(0);
43      }
44  }