edu.umd.cfar.lamp.viper.util
Class Revealer

java.lang.Object
  extended byedu.umd.cfar.lamp.viper.util.Revealer

public class Revealer
extends java.lang.Object

Shows a series of dots, or a message, over a period of time, similar to the dots that run across the screen in an id installer or the old PKZip.

Author:
David Mihalcik

Constructor Summary
Revealer()
          Constructs a new Revealer that will print 10 dots and expects 10 calls to tick.
Revealer(int total, int count, java.lang.String unit)
          Creates a new revealer that, given total ticks, will print out the specified String count number of times to System.out.
Revealer(int total, int count, java.lang.String unit, java.io.PrintWriter output)
          Creates a new revealer that, given total ticks, will print out the specified String count number of times to System.out.
 
Method Summary
 void finish()
          Print an end of line character.
 void sendError(java.lang.String err)
          Sends the error message to the list of errors occurred during this reveal
 void setTotal(int total)
          Reset the expected number of calls to ticks.
 void tick()
          Indicate a single tick.
 void tick(int times)
          Indicate multiple ticks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Revealer

public Revealer()
Constructs a new Revealer that will print 10 dots and expects 10 calls to tick.


Revealer

public Revealer(int total,
                int count,
                java.lang.String unit)
Creates a new revealer that, given total ticks, will print out the specified String count number of times to System.out.

Parameters:
total - The expected number of calls to tick.
count - The wanted number of units to be printed.
unit - The String to print out.

Revealer

public Revealer(int total,
                int count,
                java.lang.String unit,
                java.io.PrintWriter output)
Creates a new revealer that, given total ticks, will print out the specified String count number of times to System.out.

Parameters:
total - The expected number of calls to tick.
count - The wanted number of units to be printed.
unit - The String to print out.
output - Where to print the revealed stuff.
Method Detail

tick

public void tick()
Indicate a single tick.


tick

public void tick(int times)
Indicate multiple ticks. Useful for when maxticks is too large.

Parameters:
times - the number of ticks that have passed.

finish

public void finish()
Print an end of line character.


sendError

public void sendError(java.lang.String err)
Sends the error message to the list of errors occurred during this reveal

Parameters:
err - the error message

setTotal

public void setTotal(int total)
Reset the expected number of calls to ticks.

Parameters:
total - The new expected number of calls to tick().