org.xnap.commons.util
Class Progress

java.lang.Object
  extended by org.xnap.commons.util.Progress
All Implemented Interfaces:
Comparable

public class Progress
extends Object
implements Comparable

Represents the progress of a transfer.


Constructor Summary
Progress()
           
Progress(long size, long transferred)
           
 
Method Summary
 int compareTo(Object o)
          Use a higher precission to make a difference between 0 progress and 0.5.
 double getPercent()
           
 long getRate()
          Returns the current rate.
 long getSize()
           
 long getTransferred()
           
 void setRate(long rate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Progress

public Progress(long size,
                long transferred)
Parameters:
size -
transferred -
Throws:
IllegalArgumentException - if transferred is greater then size

Progress

public Progress()
Method Detail

compareTo

public int compareTo(Object o)
Use a higher precission to make a difference between 0 progress and 0.5.

Specified by:
compareTo in interface Comparable

getPercent

public double getPercent()

getRate

public long getRate()
Returns the current rate.


setRate

public void setRate(long rate)

getSize

public long getSize()

getTransferred

public long getTransferred()


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.