public class Progress extends Object
If the ProgressListener was registered with ProgressMode.INDEFINITELY, the progress reported by
getFractionTransferred() can both increase and decrease since more changes might be added while
the progres listener is registered. This means it is possible for one notification to report
true for isTransferComplete(), and then on the next event report false.
If the ProgressListener was registered with ProgressMode.CURRENT_CHANGES, progress can only ever
increase, and once isTransferComplete() returns true, no further events will be generated.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
double |
getFractionTransferred()
The fraction of bytes transferred out of all transferable bytes.
|
long |
getTransferableBytes()
Returns the total number of transferable bytes (bytes that have been transferred + bytes pending transfer).
|
long |
getTransferredBytes()
Returns the total number of bytes that has been transferred since the
ProgressListener was added. |
int |
hashCode() |
boolean |
isTransferComplete()
Returns
true when all pending bytes have been transferred. |
String |
toString() |
public long getTransferredBytes()
ProgressListener was added.ProgressListener was added.public long getTransferableBytes()
If the ProgressListener is tracking downloads, this number represents the size of the changesets
generated by all other clients using the Realm.
If the ProgressListener is tracking uploads, this number represents the size of changesets created
locally.
public double getFractionTransferred()
ProgressListener
was added.0.0 and 1.0, where 0.0 represents that no data has been
transferred yet, and 1.0 that all data has been transferred.public boolean isTransferComplete()
true when all pending bytes have been transferred.
If the ProgressListener was registered with ProgressMode.INDEFINITELY, this method can return
false for subsequent events after returning true.
If the ProgressListener was registered with ProgressMode.CURRENT_CHANGES, when this method
returns true, no more progress events will be sent.
true if all changes have been transferred, false otherwise.