|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taleo.integration.client.customstep.util.csv.MergeSort
public class MergeSort
Implementation of the Merge Sort algorithm to sort large CSV files.
Based on: Sorting-really-BIG-files
Field Summary | |
---|---|
static int |
DEFAULT_CHUNK_SIZE
The default chunk size (KB). |
Constructor Summary | |
---|---|
MergeSort()
|
Method Summary | |
---|---|
int |
getChunkSize()
Get the chunk size. |
char |
getCsvDelimiter()
Get the CSV delimiter. |
char |
getCsvQuoteCharacter()
Get the CSV quote character. |
java.lang.String |
getEncoding()
Get the encoding. |
java.lang.String |
getWorkingFolder()
Get the working folder. |
boolean |
isCsvHeaderPresent()
Get the CSV header present flag. |
boolean |
isRemoveAllDuplicates()
Get the remove all duplicates flag. |
boolean |
isRemoveDuplicates()
Get the remove duplicates flag. |
void |
setChunkSize(int chunkSize)
Set the chunk size. |
void |
setCsvDelimiter(char csvDelimiter)
Set the CSV delimiter. |
void |
setCsvHeaderPresent(boolean csvHeaderPresent)
Set the CSV header present flag. |
void |
setCsvQuoteCharacter(char csvQuoteCharacter)
Set the CSV quote character. |
void |
setEncoding(java.lang.String encoding)
Set the encoding. |
void |
setRemoveAllDuplicates(boolean removeAllDuplicates)
Set the remove all duplicates flag. |
void |
setRemoveDuplicates(boolean removeDuplicates)
Set the remove duplicates flag. |
void |
setWorkingFolder(java.lang.String workingFolder)
Set the working folder. |
void |
sort(java.io.File inFile,
java.util.Comparator comparator,
java.io.File outFile)
Sort the inFile according to the given Comparator and write result in the outFile. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_CHUNK_SIZE
Constructor Detail |
---|
public MergeSort()
Method Detail |
---|
public int getChunkSize()
public void setChunkSize(int chunkSize)
chunkSize
- public boolean isRemoveDuplicates()
public void setRemoveDuplicates(boolean removeDuplicates)
removeDuplicates
- public boolean isRemoveAllDuplicates()
public void setRemoveAllDuplicates(boolean removeAllDuplicates)
removeAllDuplicates
- public char getCsvDelimiter()
public void setCsvDelimiter(char csvDelimiter)
csvDelimiter
- public char getCsvQuoteCharacter()
public void setCsvQuoteCharacter(char csvQuoteCharacter)
csvQuoteCharacter
- public boolean isCsvHeaderPresent()
public void setCsvHeaderPresent(boolean csvHeaderPresent)
csvHeaderPresent
- public java.lang.String getEncoding()
public void setEncoding(java.lang.String encoding)
encoding
- public java.lang.String getWorkingFolder()
public void setWorkingFolder(java.lang.String workingFolder)
workingFolder
- public void sort(java.io.File inFile, java.util.Comparator comparator, java.io.File outFile) throws java.io.IOException, InvalidCSVFileFormat
The Comparator must be able to compare String arrays (String[]) corresponding to a record in the file.
inFile
- The input file.comparator
- The row comparator.outFile
- The output file.
java.io.IOException
InvalidCSVFileFormat
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |