|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xnap.transfer.AbstractTransfer
public abstract class AbstractTransfer
| Field Summary | |
|---|---|
protected static org.apache.log4j.Logger |
logger
|
static int |
MIN_RECALC_INTERVAL
Wait 50 milli seconds before calculating rate for the first time. |
static int |
RECALC_INTERVAL
|
static int |
SOCKET_TIMEOUT
The recommended default socket timeout. |
| Fields inherited from interface org.xnap.transfer.Transfer |
|---|
TRANSFER_TIMEOUT |
| Constructor Summary | |
|---|---|
AbstractTransfer()
|
|
| Method Summary | |
|---|---|
void |
addStateListener(StateListener listener)
Adds a status listener. |
void |
cleared()
Does nothing. |
long |
getAverageRate()
Returns the average transfer rate. |
protected abstract long |
getBytesTransferred()
Returns how many bytes have been transferred since the transfer was started. |
long |
getCurrentRate()
Returns the current download rate. |
java.lang.String |
getDescription()
Returns null. |
long |
getElapsedTime()
Returns the number of milli seconds that have passed since the transfer has been started. |
java.lang.String |
getFilename()
Returns the filename that should be presented to the user. |
long |
getFilesize()
Returns the final filesize. |
javax.swing.Icon |
getIcon()
Returns null. |
int |
getQueuePosition()
Returns -1. |
int |
getRemainingTime()
Returns the remaining time until the download is finished. |
Segment[] |
getSegments()
Returns the segments for segmented downloads. |
void |
removeStateListener(StateListener listener)
Remove a state listener. |
protected void |
stateChanged()
Notifies all StateListeners that the state has changed. |
java.lang.String |
toString()
|
protected void |
transferStarted()
Sub classes should invoke this method when the transfer has started. |
protected void |
transferStopped()
Sub classes should invoke this method when the transfer has stopped. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.xnap.transfer.Transfer |
|---|
getActions, getFile, getPeer, getPlugin, getStatus, getTotalBytesTransferred, isDone, isRunning |
| Field Detail |
|---|
public static final int RECALC_INTERVAL
public static final int MIN_RECALC_INTERVAL
public static final int SOCKET_TIMEOUT
protected static org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public AbstractTransfer()
| Method Detail |
|---|
public void addStateListener(StateListener listener)
Transfer
addStateListener in interface Transferpublic void cleared()
cleared in interface Transferpublic long getAverageRate()
getAverageRate in interface Transferprotected abstract long getBytesTransferred()
getCurrentRate()public long getCurrentRate()
getCurrentRate in interface Transferpublic java.lang.String getDescription()
getDescription in interface Transferpublic long getElapsedTime()
public java.lang.String getFilename()
Transfer
getFilename in interface Transferpublic long getFilesize()
Transfer
getFilesize in interface Transferpublic javax.swing.Icon getIcon()
getIcon in interface Transferpublic int getQueuePosition()
getQueuePosition in interface Transferpublic int getRemainingTime()
Transfer
getRemainingTime in interface Transferpublic void removeStateListener(StateListener listener)
Transfer
removeStateListener in interface Transferprotected void stateChanged()
public java.lang.String toString()
toString in class java.lang.Objectpublic Segment[] getSegments()
Transfer
getSegments in interface Transferprotected void transferStarted()
protected void transferStopped()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||