Class Sensor

java.lang.Object
  |
  +--Sensor

public class Sensor
extends java.lang.Object

The class Sensor is used to preprocess incoming messages.
Here they are received and classified as see, hear or other messages and forwarded to the respective event classes

Version:
1.0
Author:
Gerald Kuehne, Markus Beier

Field Summary
private  Communication communication
           
 
Constructor Summary
Sensor(Communication communication)
          Creates a new Sensor instance.
 
Method Summary
 Event receive()
          Receives incoming messages from the server.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

communication

private Communication communication
Constructor Detail

Sensor

public Sensor(Communication communication)
Creates a new Sensor instance.
Parameters:
communication - a Communication value containing the Communication class through wich the messages can be received from the server
Method Detail

receive

public Event receive()
Receives incoming messages from the server. They are automatically classified and passed on to the correct parsing/representation classes.
NOTE: The receive() method is blocking because is uses the blocking receive() method of the Communication class. Therefor the thread will be interrupted until a new message arrives.
Returns:
an Event object containing the parsed information of the read message
See Also:
Communication