org.eclipse.emf.emfstore.internal.client.model.filetransfer
Class FileTransferStatistics

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.filetransfer.FileTransferStatistics

public class FileTransferStatistics
extends Object

Statistics class that can be queried to get detailed information about a file transfer. This information might be useful to display pretty progress monitor text for example.

Author:
jfinis

Method Summary
 float getAverageThroughput()
          Returns the average throughput in bytes per second.
 int getElapsedTime()
          Returns the number of seconds the download is already active.
 int getEstimatedRemainingTime()
          Gets the number of remaining seconds (estimated).
 int getFileSize()
          .
 float getPercentTransferred()
          Returns a value between 0 and 1 stating the percentage of already transfered data.
 int getRemainingBytes()
          returns the amount of bytes that has not yet been transferred.
 int getTransferredBytes()
          .
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFileSize

public int getFileSize()
.

Returns:
the file size

getTransferredBytes

public int getTransferredBytes()
.

Returns:
the number of already transferred bytes

getPercentTransferred

public float getPercentTransferred()
Returns a value between 0 and 1 stating the percentage of already transfered data. If the transfer has not been started yet, 0 is returned. If the transfer is finished, 1 is returned.

Returns:
percentage of transfered data

getAverageThroughput

public float getAverageThroughput()
Returns the average throughput in bytes per second.

Returns:
average throughput

getEstimatedRemainingTime

public int getEstimatedRemainingTime()
Gets the number of remaining seconds (estimated). Works only if the transfer is running. If it is finished 0 is returned. If it is not yet started or canceled, then NOT_AVAILABLE is returned. If the throughput is 0, then NOT_AVAILABLE is returned as well.

Returns:
the number of remaining seconds

getRemainingBytes

public int getRemainingBytes()
returns the amount of bytes that has not yet been transferred.

Returns:
remaining bytes

getElapsedTime

public int getElapsedTime()
Returns the number of seconds the download is already active. If it is not yet active, then 0 is returned. If the download is finished or canceled, then the time in which it was active is returned.

Returns:
the elapsed time


Copyright © 2015. All Rights Reserved.