cz.cuni.amis.pogamut.defcon.communication.messages.commands
Class SetState

Package class diagram package SetState
java.lang.Object
  extended by cz.cuni.amis.pogamut.base.communication.messages.CommandMessage
      extended by cz.cuni.amis.pogamut.defcon.communication.messages.commands.DefConCommand
          extended by cz.cuni.amis.pogamut.defcon.communication.messages.commands.SetState

public class SetState
extends DefConCommand

Changes state of a unit.


Constructor Summary
SetState(int unitId, int stateId)
          Creates new instance of command SetState.
SetState(SetState original)
          Cloning constructor...
 
Method Summary
 int getStateId()
          Id of the target state.
 int getUnitId()
          Id of unit to change state of.
 void perform()
          Performs the command - to be used only by the DefConCommandExecutor.
 SetState setStateId(int stateId)
          Id of the target state.
 SetState setUnitId(int unitId)
          Id of unit to change state of.
 String toHtmlString()
          Returns message in html format.
 String toString()
          Returns human readable serialization of the message.
 
Methods inherited from class cz.cuni.amis.pogamut.defcon.communication.messages.commands.DefConCommand
getStringizedFields, toMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetState

public SetState(int unitId,
                int stateId)
Creates new instance of command SetState. Changes state of a unit.

Parameters:
unitId - Id of unit to change state of.
stateId - Id of the target state.

SetState

public SetState(SetState original)
Cloning constructor...

Parameters:
original -
Method Detail

getUnitId

public int getUnitId()
Id of unit to change state of.

Returns:
int

setUnitId

public SetState setUnitId(int unitId)
Id of unit to change state of.

Parameters:
unitId -
Returns:
this object, allows you to chain setters

getStateId

public int getStateId()
Id of the target state.

Returns:
int

setStateId

public SetState setStateId(int stateId)
Id of the target state.

Parameters:
stateId -
Returns:
this object, allows you to chain setters

perform

public void perform()
Performs the command - to be used only by the DefConCommandExecutor.

Specified by:
perform in class DefConCommand

toString

public String toString()
Returns human readable serialization of the message.

Overrides:
toString in class CommandMessage
Returns:
human readable string

toHtmlString

public String toHtmlString()
Returns message in html format.

Returns:
html message


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.