avrora.util
Class Status

java.lang.Object
  extended byavrora.util.Status

public class Status
extends java.lang.Object

The Status class is a utility that allows printing of the status (or progress) of a computation, which might involve several steps. For example, executing a simulation might require loading several programs, finding and initializing the device platform, creating a network topology, etc.


Field Summary
static boolean ENABLED
           
 
Constructor Summary
Status()
           
 
Method Summary
static void begin(java.lang.String s)
          The begin() method prints a new line with the new status.
static void error()
          The error() method simply prints out "ERROR" in a stylized fashion was well as the time since the last begin() call.
static void error(Avrora.Error e)
          The error() method simply prints out "ERROR" in a stylized fashion was well as the time since the last begin() call, and then reports the exception.
static void error(java.lang.String s)
          The error() method simply prints out an error string in a stylized fashion was well as the time since the last begin() call.
static void error(java.lang.Throwable t)
          The error() method simply prints out "ERROR" in a stylized fashion was well as the time since the last begin() call, and then reports the exception.
static void success()
          The success() method simply prints out "OK" in a stylized fashion as well as the time since the last begin() call.
static void success(java.lang.String s)
          The success() method simply prints out the success string in a stylized fashion as well as the time since the last begin() call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENABLED

public static boolean ENABLED
Constructor Detail

Status

public Status()
Method Detail

begin

public static void begin(java.lang.String s)
The begin() method prints a new line with the new status. For example, begin("Loading program"); prints the status line and an ellipsis "...", as well as recording the time at which the method was called, which can be used to recover the time spent in each stage. When the operation is completed, the success() or error() methods should be called.

Parameters:
s - the current operation being performed, as a string

success

public static void success()
The success() method simply prints out "OK" in a stylized fashion as well as the time since the last begin() call.


success

public static void success(java.lang.String s)
The success() method simply prints out the success string in a stylized fashion as well as the time since the last begin() call.

Parameters:
s - the success string to print out (instead of the default, "OK")

error

public static void error()
The error() method simply prints out "ERROR" in a stylized fashion was well as the time since the last begin() call.


error

public static void error(java.lang.String s)
The error() method simply prints out an error string in a stylized fashion was well as the time since the last begin() call.

Parameters:
s - the string to report as an error instead of "ERROR", which is the default

error

public static void error(java.lang.Throwable t)
The error() method simply prints out "ERROR" in a stylized fashion was well as the time since the last begin() call, and then reports the exception.

Parameters:
t - a throwable that was caught since the last begin()

error

public static void error(Avrora.Error e)
The error() method simply prints out "ERROR" in a stylized fashion was well as the time since the last begin() call, and then reports the exception.

Parameters:
e - an Avrora error that was caught since the last begin()