fdda.core.impl
Class StatisticsImpl

java.lang.Object
  |
  +--fdda.core.impl.StatisticsImpl
All Implemented Interfaces:
Statistics

class StatisticsImpl
extends Object
implements Statistics

Implementation of statistics interface. One instance of this class is used by each Demonstrator.

Author:
Jörg Rüdenauer

Constructor Summary
StatisticsImpl()
          Constructor
 
Method Summary
 void addActiveNode(Node node)
          Adds an active node.
 void addConnectionFailure()
          Adds 1 to the count of connection failures
 void addConnectionRecovery()
          Adds 1 to the count of connection recoveries
 void addNodeFailure()
          Adds 1 to the count of node failures
 void addNodeRecovery()
          Adds 1 to the count of node recoveries
 void addReceivedMessage()
          Adds 1 to the count of received messages
 void addSentMessage()
          Adds 1 to count of sent messages
 void addStartedNode()
          Adds 1 to the count of started nodes
 void addUsedConnection(Connection connection)
          Adds a connection to the used connections.
 void addUsedNode(Node node)
          Adds a node to the used nodes.
 int getActiveNodes()
          Returns the number of nodes that were active at one point of time
 int getConnectionFailures()
          Returns the number of connection failures (either not working at start or broken down during demo)
 int getConnectionRecoveries()
          Returns the number of connections that recovered during the demo
 int getCurrentlyActiveMessages()
          Returns the number of messages that are currently active
 int getCurrentlyActiveNodes()
          Returns the number of nodes that are currently active
 int getCurrentlyPausedNodes()
          Returns the number of nodes that are currently paused
 int getNodeFailures()
          Returns the number of node failures (either not working at start or broken down during demo)
 int getNodeRecoveries()
          Returns the number of nodes that recovered during the demo
 int getPresentConnections()
          Returns the number of connections in the project
 int getPresentNodes()
          Returns the number of nodes in the project
 int getReceivedMessages()
          Returns the number of received messages
 int getSentMessages()
          Returns the number of sent messages
 int getStartedNodes()
          Returns the number of started nodes
 int getUsedConnections()
          Returns the number of connections that were used
 int getUsedNodes()
          Returns the number of nodes that were used (either started, or active, or received a message)
 void reset()
          Resets the statistics.
 void setConnectionFailures(int number)
          Sets the number of connection failures
 void setCurrentlyActiveMessages(int number)
          Sets the number of currently active messages
 void setCurrentlyActiveNodes(int number)
          Sets the number of currently active nodes
 void setCurrentlyPausedNodes(int number)
          Sets the number of currently paused nodes
 void setNodeFailures(int number)
          Sets the number of node failures
 void setPresentConnections(int number)
          Sets the number of present connections
 void setPresentNodes(int number)
          Sets the number of present nodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsImpl

public StatisticsImpl()
Constructor

Method Detail

reset

public void reset()
Resets the statistics. All counts are set to 0.


getSentMessages

public int getSentMessages()
Description copied from interface: Statistics
Returns the number of sent messages

Specified by:
getSentMessages in interface Statistics
Returns:
# sent messages

addSentMessage

public void addSentMessage()
Adds 1 to count of sent messages


getReceivedMessages

public int getReceivedMessages()
Description copied from interface: Statistics
Returns the number of received messages

Specified by:
getReceivedMessages in interface Statistics
Returns:
# received messages

addReceivedMessage

public void addReceivedMessage()
Adds 1 to the count of received messages


getStartedNodes

public int getStartedNodes()
Description copied from interface: Statistics
Returns the number of started nodes

Specified by:
getStartedNodes in interface Statistics
Returns:
# started nodes

addStartedNode

public void addStartedNode()
Adds 1 to the count of started nodes


getActiveNodes

public int getActiveNodes()
Description copied from interface: Statistics
Returns the number of nodes that were active at one point of time

Specified by:
getActiveNodes in interface Statistics
Returns:
# active nodes

addActiveNode

public void addActiveNode(Node node)
Adds an active node. Checks whether the node was already there.

Parameters:
node - the node

getCurrentlyActiveNodes

public int getCurrentlyActiveNodes()
Description copied from interface: Statistics
Returns the number of nodes that are currently active

Specified by:
getCurrentlyActiveNodes in interface Statistics
Returns:
# currently active nodes

setCurrentlyActiveNodes

public void setCurrentlyActiveNodes(int number)
Sets the number of currently active nodes

Parameters:
number - the number

getCurrentlyPausedNodes

public int getCurrentlyPausedNodes()
Description copied from interface: Statistics
Returns the number of nodes that are currently paused

Specified by:
getCurrentlyPausedNodes in interface Statistics
Returns:
# paused nodes

setCurrentlyPausedNodes

public void setCurrentlyPausedNodes(int number)
Sets the number of currently paused nodes

Parameters:
number - the number

getCurrentlyActiveMessages

public int getCurrentlyActiveMessages()
Description copied from interface: Statistics
Returns the number of messages that are currently active

Specified by:
getCurrentlyActiveMessages in interface Statistics
Returns:
# active messages

setCurrentlyActiveMessages

public void setCurrentlyActiveMessages(int number)
Sets the number of currently active messages

Parameters:
number - the number

getUsedNodes

public int getUsedNodes()
Description copied from interface: Statistics
Returns the number of nodes that were used (either started, or active, or received a message)

Specified by:
getUsedNodes in interface Statistics
Returns:
# used nodes

addUsedNode

public void addUsedNode(Node node)
Adds a node to the used nodes. Checks whether it was already there.

Parameters:
node - the node

getPresentNodes

public int getPresentNodes()
Description copied from interface: Statistics
Returns the number of nodes in the project

Specified by:
getPresentNodes in interface Statistics
Returns:
# present nodes

setPresentNodes

public void setPresentNodes(int number)
Sets the number of present nodes

Parameters:
number - the number

getUsedConnections

public int getUsedConnections()
Description copied from interface: Statistics
Returns the number of connections that were used

Specified by:
getUsedConnections in interface Statistics
Returns:
# connections

addUsedConnection

public void addUsedConnection(Connection connection)
Adds a connection to the used connections. Checks whether it was already there.

Parameters:
connection - the connection

getPresentConnections

public int getPresentConnections()
Description copied from interface: Statistics
Returns the number of connections in the project

Specified by:
getPresentConnections in interface Statistics
Returns:
# present connections

setPresentConnections

public void setPresentConnections(int number)
Sets the number of present connections

Parameters:
number - the number

getNodeFailures

public int getNodeFailures()
Description copied from interface: Statistics
Returns the number of node failures (either not working at start or broken down during demo)

Specified by:
getNodeFailures in interface Statistics
Returns:
# node failures

addNodeFailure

public void addNodeFailure()
Adds 1 to the count of node failures


setNodeFailures

public void setNodeFailures(int number)
Sets the number of node failures

Parameters:
number - the number

getConnectionFailures

public int getConnectionFailures()
Description copied from interface: Statistics
Returns the number of connection failures (either not working at start or broken down during demo)

Specified by:
getConnectionFailures in interface Statistics
Returns:
# connection failures

addConnectionFailure

public void addConnectionFailure()
Adds 1 to the count of connection failures


setConnectionFailures

public void setConnectionFailures(int number)
Sets the number of connection failures

Parameters:
number - the number

getNodeRecoveries

public int getNodeRecoveries()
Description copied from interface: Statistics
Returns the number of nodes that recovered during the demo

Specified by:
getNodeRecoveries in interface Statistics
Returns:
# node recoveries

addNodeRecovery

public void addNodeRecovery()
Adds 1 to the count of node recoveries


getConnectionRecoveries

public int getConnectionRecoveries()
Description copied from interface: Statistics
Returns the number of connections that recovered during the demo

Specified by:
getConnectionRecoveries in interface Statistics
Returns:
# connection recoveries

addConnectionRecovery

public void addConnectionRecovery()
Adds 1 to the count of connection recoveries



API documentation for FDDA version 0.9. Generated on 17/02/2004 14:12.