Docs Menu

Docs HomeDevelop ApplicationsAtlas Device SDKs

Class Progress

On this page

  • io.realm.mongodb.sync
  • Method Summary
  • Inherited Methods
  • Method Detail
  • equals
  • getFractionTransferred
  • getTransferableBytes
  • getTransferredBytes
  • hashCode
  • isTransferComplete
  • toString
io.realm.mongodb.sync.Progress

Class used to encapsulate progress notifications when either downloading or uploading Realm data. Each instance of this class is an immutable snapshot of the current progress.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.

Tip

See also:

Modifier and Type
Method and Description
public boolean
public double

The fraction of bytes transferred out of all transferable bytes.

public long

Returns the total number of transferable bytes (bytes that have been transferred + bytes pending transfer).

public long

Returns the total number of bytes that has been transferred since the ProgressListener was added.

public int
public boolean

Returns true when all pending bytes have been transferred.

public String
  • Methods inherited from class java.lang.Object : getClass , hashCode , equals , clone , toString , notify , notifyAll , wait , wait , wait , finalize

public boolean equals (
)

Overrides

equals in class Object

public double getFractionTransferred ()

The fraction of bytes transferred out of all transferable bytes. Counting from since the ProgressListener was added.

Returns

a number between 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 long getTransferableBytes ()

Returns the total number of transferable bytes (bytes that have been transferred + bytes pending transfer).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.

Returns

the total number of bytes that has been transferred + number of bytes still pending transfer.

public long getTransferredBytes ()

Returns the total number of bytes that has been transferred since the ProgressListener was added.

Returns

the total number of bytes transferred since the ProgressListener was added.

public int hashCode ()

Overrides

hashCode in class Object

public boolean isTransferComplete ()

Returns 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.

Returns

true if all changes have been transferred, false otherwise.

public String toString ()

Overrides

toString in class Object

← Interface MutableSubscriptionSet