visidia.simulation.command
Class Command

java.lang.Object
  extended by visidia.simulation.command.Command
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AddEdgeCommand, ChangeEdgePropertyCommand, ChangeEdgeStateCommand, ChangeNodePropertyCommand, DisplaySensorNumberCommand, EndSimulationCommand, MoveAgentCommand, MoveSensorCommand, NewPulseCommand, RemoveAgentCommand, RemoveEdgeCommand, SendMessageCommand, SetSensorNumberCommand

public abstract class Command
extends java.lang.Object
implements java.io.Serializable

Command is the abstract base class to manages commands exchanged between console and processes.

See Also:
Serialized Form

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

Constructor Detail

Command

protected Command()
Instantiates a new command.

Method Detail

needSynchronization

public abstract boolean needSynchronization()
Defines if command needs synchronization.

Returns:
true, if to be synchronized

generateImmediateAck

public abstract boolean generateImmediateAck()
Defines if an ack is to be generated immediately.

Returns:
true, if an ack must be generated immediately

executeBeforeAck

public abstract void executeBeforeAck(VisidiaEvent event)
Instructions to be executed before ack.

Parameters:
event - the event

executeAfterAck

public abstract void executeAfterAck()
                              throws java.lang.InterruptedException
Instructions to be executed after ack.

Throws:
java.lang.InterruptedException - the interrupted exception

serialize

public abstract void serialize(java.io.ObjectOutputStream out)
                        throws java.io.IOException
Serialize.

Parameters:
out - the output stream
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

deserialize

public abstract void deserialize(java.io.ObjectInputStream in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
Deserialize.

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