edu.mit.jmwe.util
Class NullProgressBar

java.lang.Object
  extended by edu.mit.jmwe.util.NullProgressBar
All Implemented Interfaces:
IProgressBar

public class NullProgressBar
extends Object
implements IProgressBar

Creates a progress bar that does nothing and prints nothing. Can be used when an implementation requires a progress bar but you have none to give it.

This class is a singleton. It may be subclassed, but not directly instantiated.

Since:
jMWE 1.0.0
Version:
$Id: NullProgressBar.java 560 2011-05-05 19:25:15Z markaf $
Author:
M.A. Finlayson

Constructor Summary
protected NullProgressBar()
          This constructor is marked protected so that this class may be subclassed, but not directly instantiated.
 
Method Summary
 void finish()
          Stops the progress bar and prints the total time that the progress bar ran.
 int getCount()
          Returns the current state of the progress bar, that is, the number of units of progress that have been reported to it.
 Date getEndTime()
          Returns the date and time on which this progress bar was finished.
 int getExpected()
          Returns the expected number of units of progress.
 int getExpectedTicks()
          Returns the expected number of ticks.
static NullProgressBar getInstance()
          Returns the singleton instance of this class, creating it if necessary.
 Date getStartTime()
          Returns the date and time on which this progress bar was started.
 double getStepSize()
          Returns the number of units of progress that are represented by one tick.
 int getTickCount()
          Returns the number of current progress bar ticks that have been used.
 void increment()
          Increments the progress bar by 1.
 void increment(int amount)
          Increments the progress bar by a given amount.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullProgressBar

protected NullProgressBar()
This constructor is marked protected so that this class may be subclassed, but not directly instantiated.

Since:
jMWE 1.0.0
Method Detail

getInstance

public static NullProgressBar getInstance()
Returns the singleton instance of this class, creating it if necessary.

Returns:
the singleton Null progress bar
Since:
jMWE 1.0.0

getCount

public int getCount()
Description copied from interface: IProgressBar
Returns the current state of the progress bar, that is, the number of units of progress that have been reported to it.

Specified by:
getCount in interface IProgressBar
Returns:
the number of units of progress so far reported

getTickCount

public int getTickCount()
Description copied from interface: IProgressBar
Returns the number of current progress bar ticks that have been used.

Specified by:
getTickCount in interface IProgressBar
Returns:
the number of current progress bar ticks that have been used.

getExpected

public int getExpected()
Description copied from interface: IProgressBar
Returns the expected number of units of progress.

Specified by:
getExpected in interface IProgressBar
Returns:
the expected number of units of progress.

getExpectedTicks

public int getExpectedTicks()
Description copied from interface: IProgressBar
Returns the expected number of ticks.

Specified by:
getExpectedTicks in interface IProgressBar
Returns:
the expected number of ticks.

getStepSize

public double getStepSize()
Description copied from interface: IProgressBar
Returns the number of units of progress that are represented by one tick.

Specified by:
getStepSize in interface IProgressBar
Returns:
the number of units of progress that are represented by one tick.

getStartTime

public Date getStartTime()
Description copied from interface: IProgressBar
Returns the date and time on which this progress bar was started.

Specified by:
getStartTime in interface IProgressBar
Returns:
the date and time on which this progress bar was started.

getEndTime

public Date getEndTime()
Description copied from interface: IProgressBar
Returns the date and time on which this progress bar was finished. If the progress bar is not yet finished, will return null.

Specified by:
getEndTime in interface IProgressBar
Returns:
the date and time on which this progress bar was finished, or null if not yet finished.

increment

public void increment()
Description copied from interface: IProgressBar
Increments the progress bar by 1.

Specified by:
increment in interface IProgressBar

increment

public void increment(int amount)
Description copied from interface: IProgressBar
Increments the progress bar by a given amount.

Specified by:
increment in interface IProgressBar
Parameters:
amount - amount by which the progress bar will be incremented

finish

public void finish()
Description copied from interface: IProgressBar
Stops the progress bar and prints the total time that the progress bar ran.

Specified by:
finish in interface IProgressBar


Copyright © 2011 Massachusetts Institute of Technology. All Rights Reserved.