Package com.atlassian.bamboo.progressbar
Class ProgressBarImpl
- java.lang.Object
-
- com.atlassian.bamboo.progressbar.ProgressBarImpl
-
- All Implemented Interfaces:
ProgressBar
- Direct Known Subclasses:
BuildProgressBarImpl
public class ProgressBarImpl extends Object implements ProgressBar
-
-
Constructor Summary
Constructors Constructor Description ProgressBarImpl(ExecutionStatus executionStatus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getEstimatedDuration()
Returns prospected duration of a task.double
getPercentageCompleted()
Elapsed time / total timeString
getPercentageCompletedAsString()
String
getPrettyTimeRemaining()
String
getPrettyTimeRemaining(boolean isLong)
int
getTimeElapsedWidth()
Return the width of the "elapsed time" progress barint
getTotalTimeWidth()
Return the width of the "total time" progress barboolean
isUnderAverageTime()
Returns true if elapse time < ave timeboolean
isValid()
Returns true iff the ave time is > 0
-
-
-
Constructor Detail
-
ProgressBarImpl
public ProgressBarImpl(ExecutionStatus executionStatus)
-
-
Method Detail
-
isValid
public boolean isValid()
Description copied from interface:ProgressBar
Returns true iff the ave time is > 0- Specified by:
isValid
in interfaceProgressBar
- Returns:
-
isUnderAverageTime
public boolean isUnderAverageTime()
Description copied from interface:ProgressBar
Returns true if elapse time < ave time- Specified by:
isUnderAverageTime
in interfaceProgressBar
- Returns:
- true if elapse time < ave time
-
getPercentageCompleted
public double getPercentageCompleted()
Description copied from interface:ProgressBar
Elapsed time / total time- Specified by:
getPercentageCompleted
in interfaceProgressBar
- Returns:
- Elapsed time / total time
-
getPrettyTimeRemaining
public String getPrettyTimeRemaining(boolean isLong)
- Specified by:
getPrettyTimeRemaining
in interfaceProgressBar
- Parameters:
isLong
- true if you want the long-winded version, false if you want the short version- Returns:
- Returns the approximate amount of time remaining
-
getPrettyTimeRemaining
public String getPrettyTimeRemaining()
- Specified by:
getPrettyTimeRemaining
in interfaceProgressBar
- Returns:
- Returns the approximate amount of time remaining
-
getPercentageCompletedAsString
public String getPercentageCompletedAsString()
- Specified by:
getPercentageCompletedAsString
in interfaceProgressBar
-
getTotalTimeWidth
public int getTotalTimeWidth()
Description copied from interface:ProgressBar
Return the width of the "total time" progress bar- Specified by:
getTotalTimeWidth
in interfaceProgressBar
- Returns:
- width of bar
-
getTimeElapsedWidth
public int getTimeElapsedWidth()
Description copied from interface:ProgressBar
Return the width of the "elapsed time" progress bar- Specified by:
getTimeElapsedWidth
in interfaceProgressBar
- Returns:
-
getEstimatedDuration
public long getEstimatedDuration()
Description copied from interface:ProgressBar
Returns prospected duration of a task.- Specified by:
getEstimatedDuration
in interfaceProgressBar
- Returns:
- estimated execution total time in milliseconds
-
-