visidia.simulation.command
Class MoveSensorCommand

java.lang.Object
  extended by visidia.simulation.command.Command
      extended by visidia.simulation.command.MoveSensorCommand
All Implemented Interfaces:
java.io.Serializable

public class MoveSensorCommand
extends Command

MoveSensorCommand is the command involved when a sensor moves.

See Also:
Serialized Form

Constructor Summary
MoveSensorCommand(int sensorId, int originId, int destinationId)
          Instantiates a new move sensor command.
 
Method Summary
 void deserialize(java.io.ObjectInputStream in)
          Deserialize.
 void executeAfterAck()
          Instructions to be executed after ack.
 void executeBeforeAck(VisidiaEvent event)
          Instructions to be executed before ack.
 boolean generateImmediateAck()
          Defines if an ack is to be generated immediately.
 boolean needSynchronization()
          Defines if command needs synchronization.
 void serialize(java.io.ObjectOutputStream out)
          Serialize.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MoveSensorCommand

public MoveSensorCommand(int sensorId,
                         int originId,
                         int destinationId)
Instantiates a new move sensor command.

Parameters:
sensorId - the sensor id
originId - the origin id
destinationId - the destination id
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

needSynchronization

public boolean needSynchronization()
Description copied from class: Command
Defines if command needs synchronization.

Specified by:
needSynchronization in class Command
Returns:
true, if to be synchronized

generateImmediateAck

public boolean generateImmediateAck()
Description copied from class: Command
Defines if an ack is to be generated immediately.

Specified by:
generateImmediateAck in class Command
Returns:
true, if an ack must be generated immediately

executeBeforeAck

public void executeBeforeAck(VisidiaEvent event)
Description copied from class: Command
Instructions to be executed before ack.

Specified by:
executeBeforeAck in class Command
Parameters:
event - the event

executeAfterAck

public void executeAfterAck()
                     throws java.lang.InterruptedException
Description copied from class: Command
Instructions to be executed after ack.

Specified by:
executeAfterAck in class Command
Throws:
java.lang.InterruptedException - the interrupted exception

serialize

public void serialize(java.io.ObjectOutputStream out)
               throws java.io.IOException
Description copied from class: Command
Serialize.

Specified by:
serialize in class Command
Parameters:
out - the output stream
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

deserialize

public void deserialize(java.io.ObjectInputStream in)
                 throws java.io.IOException,
                        java.lang.ClassNotFoundException
Description copied from class: Command
Deserialize.

Specified by:
deserialize in class Command
Parameters:
in - the input stream
Throws:
java.io.IOException - Signals that an I/O exception has occurred.
java.lang.ClassNotFoundException - the class not found exception