|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.dna.common.monitor.ProgressStatus
@Immutable public class ProgressStatus
A snapshot of the progress on an activity.
| Field Summary | |
|---|---|
protected static double |
PERCENT_PRECISION
|
protected static String |
PERCENTAGE_PATTERN
|
| Constructor Summary | |
|---|---|
ProgressStatus(String activityName,
String message,
double percentWorked,
boolean cancelled)
Create the progress status. |
|
ProgressStatus(String activityName,
String message,
double workedSoFar,
double totalWork,
boolean cancelled)
Create the progress status and compute the percentage worked. |
|
| Method Summary | |
|---|---|
int |
compareTo(ProgressStatus that)
|
protected static double |
computePercentage(double workedSoFar,
double totalWork)
Compute the percentage worked, accounting for imprecision in |
boolean |
equals(Object obj)
|
String |
getActivityName()
Get the name of the activity. |
String |
getMessage()
Get the progress monitor's text message. |
double |
getPercentWorked()
Get the progress as a percentage of the total work that's been completed. |
int |
hashCode()
|
boolean |
isCancelled()
Return whether the activity was requested to be cancelled. |
boolean |
isDone()
Return whether work on this activity has completed. |
protected static boolean |
isSamePercentage(double percentage1,
double percentage2)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final String PERCENTAGE_PATTERN
protected static final double PERCENT_PRECISION
| Constructor Detail |
|---|
public ProgressStatus(String activityName,
String message,
double percentWorked,
boolean cancelled)
activityName - the name of the activity, which may not be nullmessage - the message for the progress, which may not be nullpercentWorked - the percentage worked, ranging from 0.0 for not started to 100.0 for complete; a negative value are
treated as 0.0, while a value greater than 100.0 is treated as 100.0cancelled - true if the activity has been requested to be cancelled, or false otherwise
public ProgressStatus(String activityName,
String message,
double workedSoFar,
double totalWork,
boolean cancelled)
activityName - the name of the activity, which may not be nullmessage - the message for the progress, which may not be nullworkedSoFar - the amount of work so far percentage workedtotalWork - the total amount of work for this activitycancelled - true if the activity has been requested to be cancelled, or false otherwise| Method Detail |
|---|
protected static double computePercentage(double workedSoFar,
double totalWork)
workedSoFar - the amount of work so far percentage workedtotalWork - the total amount of work for this activity
protected static boolean isSamePercentage(double percentage1,
double percentage2)
public String getActivityName()
public double getPercentWorked()
public String getMessage()
public boolean isDone()
isCancelled()public boolean isCancelled()
isDone()public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Objectpublic int compareTo(ProgressStatus that)
compareTo in interface Comparable<ProgressStatus>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||