com.atlassian.bamboo.progressbar
Class ProgressBarImpl

java.lang.Object
  extended by com.atlassian.bamboo.progressbar.ProgressBarImpl
All Implemented Interfaces:
ProgressBar
Direct Known Subclasses:
BuildProgressBarImpl

public class ProgressBarImpl
extends java.lang.Object
implements ProgressBar


Constructor Summary
ProgressBarImpl(ExecutionStatus executionStatus)
           
 
Method Summary
 long getEstimatedDuration()
          Returns prospected duration of a task.
 double getPercentageCompleted()
          Elapsed time / total time
 java.lang.String getPercentageCompletedAsString()
           
 java.lang.String getPrettyTimeRemaining()
           
 java.lang.String getPrettyTimeRemaining(boolean isLong)
           
 int getTimeElapsedWidth()
          Return the width of the "elapsed time" progress bar
 int getTotalTimeWidth()
          Return the width of the "total time" progress bar
 boolean isUnderAverageTime()
          Returns true if elapse time < ave time
 boolean isValid()
          Returns true iff the ave time is > 0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface ProgressBar
Returns:

isUnderAverageTime

public boolean isUnderAverageTime()
Description copied from interface: ProgressBar
Returns true if elapse time < ave time

Specified by:
isUnderAverageTime in interface ProgressBar
Returns:
true if elapse time < ave time

getPercentageCompleted

public double getPercentageCompleted()
Description copied from interface: ProgressBar
Elapsed time / total time

Specified by:
getPercentageCompleted in interface ProgressBar
Returns:
Elapsed time / total time

getPrettyTimeRemaining

public java.lang.String getPrettyTimeRemaining(boolean isLong)
Specified by:
getPrettyTimeRemaining in interface ProgressBar
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 java.lang.String getPrettyTimeRemaining()
Specified by:
getPrettyTimeRemaining in interface ProgressBar
Returns:
Returns the approximate amount of time remaining

getPercentageCompletedAsString

public java.lang.String getPercentageCompletedAsString()
Specified by:
getPercentageCompletedAsString in interface ProgressBar

getTotalTimeWidth

public int getTotalTimeWidth()
Description copied from interface: ProgressBar
Return the width of the "total time" progress bar

Specified by:
getTotalTimeWidth in interface ProgressBar
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 interface ProgressBar
Returns:

getEstimatedDuration

public long getEstimatedDuration()
Description copied from interface: ProgressBar
Returns prospected duration of a task.

Specified by:
getEstimatedDuration in interface ProgressBar
Returns:
estimated execution total time in milliseconds


Copyright © 2011 Atlassian. All Rights Reserved.