visidia.simulation.command
Class ChangeEdgeStateCommand

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

public class ChangeEdgeStateCommand
extends Command

ChangeEdgeStateCommand is the command involved when a edge state changes.

See Also:
Serialized Form

Constructor Summary
ChangeEdgeStateCommand(int vertexId, int door, EdgeState newEdgeState)
          Instantiates a new command to change an edge state.
 
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

ChangeEdgeStateCommand

public ChangeEdgeStateCommand(int vertexId,
                              int door,
                              EdgeState newEdgeState)
Instantiates a new command to change an edge state.

Parameters:
door - the door
newEdgeState - the new edge state
vertexId - the vertex 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()
Description copied from class: Command
Instructions to be executed after ack.

Specified by:
executeAfterAck in class Command

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