|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jscape.filetransfer.FileTransferRemoteSort
Sorts an Enumeration of FileTransferRemoteFile. The user must
specify a Comparator instance which will be used by the sort algorithm.
The following is an example usage
FtpTransfer ftp = new FtpTransfer(host, user, password, port);
ftp.connect();
// Get the remote files enumeration
Enumeration e = ftp.getDirListing();
//Creates the sorter with the file date comparator
FileTransferRemoteSort sorter = new FileTransferRemoteSort(e,
new FileTransferRemoteSort.FileDateComparator());
// sort in ascending order
sorter.setAscendent(true);
// sorts enumeration
e = sorter.sort();
| Nested Class Summary | |
static class |
FileTransferRemoteSort.FileDateComparator
Sorts files by date. |
static class |
FileTransferRemoteSort.FileNameComparator
Sorts files by name. |
static class |
FileTransferRemoteSort.FileSizeComparator
Sorts files by filesize. |
| Constructor Summary | |
FileTransferRemoteSort(java.util.Enumeration e,
com.jscape.filetransfer.FileTransferRemoteComparator comparator)
Creates a new FileTransferRemoteSort instance used to sort an Enumeration of FileTransferRemoteFile. |
|
| Method Summary | |
com.jscape.filetransfer.FileTransferRemoteComparator |
getComparator()
Gets FileTransferRemoteComparator instance. |
java.util.Enumeration |
getData()
Gets the data to be sorted. |
boolean |
isAscendent()
Gets whether sort will be performed in ascending or descending order. |
void |
setAscendent(boolean ascendent)
Sets whether sort will be performed in ascending or descending order. |
void |
setComparator(com.jscape.filetransfer.FileTransferRemoteComparator comparator)
Sets FileTransferRemoteComparator. |
void |
setData(java.util.Enumeration e)
Sets the data to be sorted. |
java.util.Enumeration |
sort()
Sorts the data. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FileTransferRemoteSort(java.util.Enumeration e,
com.jscape.filetransfer.FileTransferRemoteComparator comparator)
FileTransferRemoteSort instance used to sort an Enumeration of FileTransferRemoteFile.
e - an Enumeration containing remote filescomparator - the Comparator to use in sorting| Method Detail |
public com.jscape.filetransfer.FileTransferRemoteComparator getComparator()
FileTransferRemoteComparator instance.
FileTransferRemoteComparatorpublic void setComparator(com.jscape.filetransfer.FileTransferRemoteComparator comparator)
FileTransferRemoteComparator.
comparator - a FileTransferRemoteComparatorpublic void setAscendent(boolean ascendent)
ascendent - if true the data will be sorted in ascending orderpublic boolean isAscendent()
true if the data will be sorted in ascending orderpublic void setData(java.util.Enumeration e)
e - an Enumeration of FileTransferRemoteFilepublic java.util.Enumeration getData()
Enumeration of FileTranferRemoteFilepublic java.util.Enumeration sort()
Enumeration of FileTransferRemoteFile
|
Secure iNet Factory | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||