Class LargeFileSorter<T>


  • public class LargeFileSorter<T>
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      LargeFileSorter​(java.util.function.Function<java.io.File,​LargeFileReader<T>> fileReaderFactory, java.util.function.Function<java.io.File,​LargeFileWriter<T>> fileWriterFactory, java.util.Comparator<T> entryComparator, java.util.function.Supplier<java.io.File> tempFileCreator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.io.File sortLargeFile​(java.io.File inputFile)
      Sorts a large file using entryComparator.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INITIAL_FILE_CHUNK_SIZE_TO_SORT_IN_MEMORY

        public static final int INITIAL_FILE_CHUNK_SIZE_TO_SORT_IN_MEMORY
        See Also:
        Constant Field Values
    • Constructor Detail

      • LargeFileSorter

        public LargeFileSorter​(java.util.function.Function<java.io.File,​LargeFileReader<T>> fileReaderFactory,
                               java.util.function.Function<java.io.File,​LargeFileWriter<T>> fileWriterFactory,
                               java.util.Comparator<T> entryComparator,
                               java.util.function.Supplier<java.io.File> tempFileCreator)
    • Method Detail

      • sortLargeFile

        public java.io.File sortLargeFile​(java.io.File inputFile)
                                   throws java.io.IOException
        Sorts a large file using entryComparator.
        Parameters:
        inputFile - the input stream to sort
        Throws:
        java.io.IOException