Elementary and no so elementary Java algorithms
sort.TestMergeSortFile Class Reference

List of all members.


class  TestObj

Public Member Functions

boolean testSortFile (final int numVals, final int bufSize)
void testTheTester ()
void testEven ()
void testOdd ()
void testValsEqBuf ()
void testObjectSort ()

Protected Member Functions

void cleanupFiles (File inFile, File outFile)

Package Functions

protected< T extends
Comparable< T > &Serializable >
writeObjs (T[] objs, File outFile) throws IOException
protected< T extends
Comparable< T > &Serializable >
testFile (File sortedFile) throws IOException, ClassNotFoundException

Detailed Description

TestMergeSortFile Jun 26, 2013

A test for file merge sort.

Ian Kaplan,

Definition at line 37 of file

Member Function Documentation

void sort.TestMergeSortFile.cleanupFiles ( File  inFile,
File  outFile 
) [protected]

Definition at line 139 of file

void sort.TestMergeSortFile.testEven ( )

Test for the case where the buffer/temporary file size is an even multiple of the total number of Integer elements.

Definition at line 215 of file

protected<T extends Comparable<T> & Serializable> boolean sort.TestMergeSortFile.testFile ( File  sortedFile) throws IOException, ClassNotFoundException [package]

Definition at line 96 of file

void sort.TestMergeSortFile.testObjectSort ( )

Test a case where a simple key/value object is sorted. The ability to sort arbitrary comparable/serializable objects is where the merge sort stands out.

Definition at line 239 of file

void sort.TestMergeSortFile.testOdd ( )

Definition at line 221 of file

boolean sort.TestMergeSortFile.testSortFile ( final int  numVals,
final int  bufSize 

Test a simple file sort, where the buffer is an even multiple of the number of objects in the file.

numValsNumber of test values to sort
bufSizeThe number of objects to sort in memory
true if the random values in test file were sorted, false otherwise.

Definition at line 155 of file

void sort.TestMergeSortFile.testTheTester ( )

Make sure that the file check works correctly

Definition at line 186 of file

void sort.TestMergeSortFile.testValsEqBuf ( )

Definition at line 227 of file

protected<T extends Comparable<T> & Serializable> void sort.TestMergeSortFile.writeObjs ( T[]  objs,
File  outFile 
) throws IOException [package]

Definition at line 68 of file

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables