Class org.as2lib.app.exec.AbstractTimeConsumer

Description

AbstractTimeConsumer represents a time consuming class.

It saves and provides informations about the time that the concrete class used.

The concrete implementation needs to take care of startTime, endTime, getPercentage, started and finished.

Field Index

Inherited from LogSupport

Method Index

new AbstractTimeConsumer()
getDuration(), getEstimatedRestTime(), getEstimatedTotalTime(), getPercentage(), hasFinished(), hasStarted()

Inherited from EventSupport

Inherited from LogSupport

Inherited from BasicClass

Constructor Detail

AbstractTimeConsumer

public function AbstractTimeConsumer(Void)

Constructs a new AbstractTimeConsumer.

Method Detail

hasFinished

public function hasFinished(Void):Boolean

Returns true if the process has finished.

If the process has not been started it returns false.

Return

true if the process has finished

hasStarted

public function hasStarted(Void):Boolean

Returns true if the process has started.

If the process has finished it returns false.

Return

true if the process has started

getPercentage

public function getPercentage(Void):Number

Returns the percentage of execution

Override this implementation for a matching result.

Return

null, override this implementation

getDuration

public function getDuration(Void):Time

Returns the time of the execution of the process.

Return

time difference between start time and end time/current time.

getEstimatedTotalTime

public function getEstimatedTotalTime(Void):Time

Estimates the approximate time for the complete execution of the process.

Return

estimated duration at the end of the process

getEstimatedRestTime

public function getEstimatedRestTime(Void):Time

Estimates the approximate time until the execution finishes.

Return

estimated time until finish of the process