springs.access
Class ReferenceUpdateCommands

java.lang.Object
  |
  +--springs.access.ReferenceUpdateCommands

public class ReferenceUpdateCommands
extends java.lang.Object

Contains instructions to update references to agents. It is implemented as a FIFO queue.

Author:
Sergio Ilarri Artigas

Field Summary
private  double _arrivalRate
           
private  java.util.Vector _commands
           
private  java.util.Vector _insertionTimes
           
private  long _millisFirstCommand
           
private  int _numArrivedCommands
          To compute the throughput of commands.
 
Constructor Summary
ReferenceUpdateCommands()
          Constructor.
 
Method Summary
 double getArrivalRate()
          Gets the arrival rate of remote tuples, per second.
 springs.access.ReferenceUpdateCommand popCommand()
          Gets the first command from the table and removes it.
 void removeCommand(java.lang.String agentName)
          Removes a command that requests the update for an agent with the given name.
 void set(java.lang.String agentName, springs.access.ReferenceUpdateCommand c)
          Sets the commands for the given agent.
 int size()
          Gets the number of remote agent references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_commands

private java.util.Vector _commands

_insertionTimes

private java.util.Vector _insertionTimes

_numArrivedCommands

private int _numArrivedCommands
To compute the throughput of commands.


_arrivalRate

private double _arrivalRate

_millisFirstCommand

private long _millisFirstCommand
Constructor Detail

ReferenceUpdateCommands

public ReferenceUpdateCommands()
Constructor.

Method Detail

set

public void set(java.lang.String agentName,
                springs.access.ReferenceUpdateCommand c)
Sets the commands for the given agent.

Parameters:
agentName - the name of the agent.
c - the command.
See Also:
String, ReferenceUpdateCommand

popCommand

public springs.access.ReferenceUpdateCommand popCommand()
Gets the first command from the table and removes it.

Returns:
the first command, null if any.
See Also:
ReferenceUpdateCommand

removeCommand

public void removeCommand(java.lang.String agentName)
Removes a command that requests the update for an agent with the given name. It only removes the first occurrence, if several.

Parameters:
agentName - the name of the agent.
See Also:
String

size

public int size()
Gets the number of remote agent references.

Returns:
the number.

getArrivalRate

public double getArrivalRate()
Gets the arrival rate of remote tuples, per second.

Returns:
the arrival rate, in tuples per second.