|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.util.ProgressBar
public class ProgressBar
Default implementation of IProgressBar
.
Field Summary | |
---|---|
static int |
DEFAULT_TICKS
Default number of ticks for a progress bar. |
Constructor Summary | |
---|---|
ProgressBar(int expected)
Creates a progress bar that expects the specified number of increments. |
|
ProgressBar(int expected,
int ticks)
Creates a progress bar that expects the specified number of increments, and reports progress across a bar the specified number of ticks wide. |
|
ProgressBar(int expected,
int ticks,
boolean printDate)
Constructs a new progress bar that has an expected number of observations compressed into a specified number of ticks, and optionally prints the time and memory delta between instantiation and calling the finish() method. |
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. |
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 i)
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 |
Field Detail |
---|
public static final int DEFAULT_TICKS
Constructor Detail |
---|
public ProgressBar(int expected)
expected
- the number of increments that are expected
IllegalArgumentException
- if the number of expected increments is not positive.public ProgressBar(int expected, int ticks)
expected
- the number of increments that are expectedticks
- the length of the progress bar, in ticks
IllegalArgumentException
- if the number of expected increments or the number of printed
ticks is not positive.public ProgressBar(int expected, int ticks, boolean printDate)
finish()
method.
expected
- the number of increments that are expectedticks
- the length of the progress bar, in ticksprintDate
- if true
, the progress bar will print the start
and end date
IllegalArgumentException
- if the number of expected increments or the number of printed
ticks is not positive.Method Detail |
---|
public void increment()
IProgressBar
increment
in interface IProgressBar
public void increment(int i)
IProgressBar
increment
in interface IProgressBar
i
- amount by which the progress bar will be incrementedpublic void finish()
IProgressBar
finish
in interface IProgressBar
public int getExpected()
IProgressBar
getExpected
in interface IProgressBar
public int getExpectedTicks()
IProgressBar
getExpectedTicks
in interface IProgressBar
public Date getStartTime()
IProgressBar
getStartTime
in interface IProgressBar
public Date getEndTime()
IProgressBar
null
.
getEndTime
in interface IProgressBar
null
if not yet finished.public int getCount()
IProgressBar
getCount
in interface IProgressBar
public int getTickCount()
IProgressBar
getTickCount
in interface IProgressBar
public double getStepSize()
IProgressBar
getStepSize
in interface IProgressBar
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |