-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Nuix/enhancements/custom-exporter/more-co…
…nfiguration Enhancements/custom exporter/more configuration
- Loading branch information
Showing
6 changed files
with
327 additions
and
15 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
Java/SuperUtilities/src/main/java/com/nuix/superutilities/misc/BoundedProgressInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.nuix.superutilities.misc; | ||
|
||
import lombok.Getter; | ||
|
||
/*** | ||
* Represents progress of an operation which has a bounded value, that is, we known what progress | ||
* value is considered maximum/done. | ||
*/ | ||
@Getter | ||
public class BoundedProgressInfo extends ProgressInfo { | ||
/*** | ||
* The maximum progress value | ||
*/ | ||
protected final long maximum; | ||
|
||
public BoundedProgressInfo(String stage, long current, long maximum) { | ||
super(stage, current); | ||
this.maximum = maximum; | ||
} | ||
|
||
/*** | ||
* Provides a percentage completed value by dividing double value of current by | ||
* double value of maximum. | ||
* @return A double value representing percentage complete | ||
*/ | ||
public double percentageComplete() { | ||
return ((double) current) / ((double) maximum); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "BoundedProgressInfo [stage=" + stage + ", " + current + "/" + maximum + "]"; | ||
} | ||
} |
Oops, something went wrong.