public final class Progress
extends java.lang.Object
Progress can be either determinate or indeterminate. Determinate progress
gives an estimate of how much work is already done and how much more work
remains. Indeterminate progress means that progress is being made but it is
not clear how much more work remains. For determinate progress
getMin()
is strictly less than getMax()
and
getCurrent()
is a value in the closed interval from
getMin()
to getMax()
. For indeterminate progress
getMin()
must be equal to getMax()
and
getCurrent()
is any non-negative value.
The same determinate progress can be represented in multiple ways (all semantically equivalent). For example 50% progress can be represented as (min=0, max=100, current=50) or (min=0, max=10, current=5) or (min=0, max=4, current=2) etc.
The order of progress notifications is not guaranteed. The consumer of progress notifications should ignore progress notifications that go backwards (i.e. decreasing current progress value).
Constructor and Description |
---|
Progress(long min,
long max,
long current)
Creates a progress notification.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
long |
getCurrent() |
long |
getMax() |
long |
getMin() |
int |
hashCode() |
java.lang.String |
toString() |
public Progress(long min, long max, long current)
min
- minimum value in the progress range; must be non-negativemax
- maximum value in the progress range; must be non-negativecurrent
- current progress value; must be non-negativejava.lang.IllegalArgumentException
- if the field values are invalidpublic long getMin()
public long getMax()
public long getCurrent()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object