gecco.server.actionprocessor
Class QueuedAction

java.lang.Object
  |
  +--gecco.server.actionprocessor.QueuedAction
All Implemented Interfaces:
Comparable

public class QueuedAction
extends Object
implements Comparable

This class is a wrapper object that is stored in the priority queue in the ActionProcessor.

Author:
Henrik Hägerström

Field Summary
private  long absoluteTimeToExecute
          Description of the Field
private  Action action
          Description of the Field
private  String fromRole
          Description of the Field
 
Constructor Summary
QueuedAction(String _fromRole, Action _action, long absoluteTimeToExecute)
          Instanciates a QueuedAction object.
 
Method Summary
 int compareTo(Object a)
          Description of the Method
 boolean equals(Object a)
          Description of the Method
 Action getAction()
          Gets the Action attribute of the QueuedAction object
 String getFromRole()
          Gets the FromRole attribute of the QueuedAction object
 long getTimeToExecute()
          Gets the TimeToExecute attribute of the QueuedAction object
 void setTimeToExecute(long newTimeToExecute)
          Sets the TimeToExecute attribute of the QueuedAction object
 
Methods inherited from class java.lang.Object
, clone, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

action

private Action action
Description of the Field

fromRole

private String fromRole
Description of the Field

absoluteTimeToExecute

private long absoluteTimeToExecute
Description of the Field
Constructor Detail

QueuedAction

public QueuedAction(String _fromRole,
                    Action _action,
                    long absoluteTimeToExecute)
Instanciates a QueuedAction object.
Parameters:
_fromRole - The commanding role
_action - The action to be executed
absoluteTimeToExecute - The time to execute next checkpoint for the action
Method Detail

setTimeToExecute

public void setTimeToExecute(long newTimeToExecute)
Sets the TimeToExecute attribute of the QueuedAction object
Parameters:
newTimeToExecute - The new TimeToExecute value

getAction

public Action getAction()
Gets the Action attribute of the QueuedAction object
Returns:
The Action value

getFromRole

public String getFromRole()
Gets the FromRole attribute of the QueuedAction object
Returns:
The FromRole value

getTimeToExecute

public long getTimeToExecute()
Gets the TimeToExecute attribute of the QueuedAction object
Returns:
The TimeToExecute value

equals

public boolean equals(Object a)
Description of the Method
Overrides:
equals in class Object
Parameters:
a - Description of Parameter
Returns:
Description of the Returned Value

compareTo

public int compareTo(Object a)
Description of the Method
Specified by:
compareTo in interface Comparable
Parameters:
a - Description of Parameter
Returns:
Description of the Returned Value