|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.internet2.middleware.ldappc.util.ExternalSort
public final class ExternalSort
This package implement an external merge sort based on Collections sorting. An input file is divided into batches, which are sorted separately using the Collections.sort method. These batches are then merged into a single sorted file. The resulting file overwrites the initial file. The intermediate batch files are deleted.
| Method Summary | |
|---|---|
static void |
main(String[] args)
Main method to use for external testing of this routine. |
static void |
sort(String filename)
Sort a file using the default batch size. |
static void |
sort(String filename,
int batchSize)
Sort a file using the batch size provided. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static void main(String[] args)
args - Command line args: filename - the file to be sorted; batchsize - the number
of lines to be sorted in memory.
public static void sort(String filename)
throws IOException
filename - The file to be sorted.
IOException - Thrown if a file cannot be read or written.
public static void sort(String filename,
int batchSize)
throws IOException
filename - the file to be sorted.batchSize - the batch size, that is, the number of lines to batch and sort in memory.
IOException - Thrown if a file cannot be read or written.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||