Package dev.tylermong.customhashmap
Class CustomHashMapTester
java.lang.Object
dev.tylermong.customhashmap.CustomHashMapTester
This class tests the functionality of the CustomHashMap class and compares its performance with the Java HashMap. It
includes tests for different key-value pairs and performance comparisons for various sizes of data
- Version:
- 1.0
- Author:
- Tyler Mong
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCalls the performance comparison method for different sizes of data.voidperformanceComparisonWithSize(int size) Compares the performance of the CustomHashMap to the Java HashMap for a given size of data.voidRuns all the test in this class along with the performance comparison tests.voidTests the functionality of the CustomHashMap with Integer keys and Double values.voidTests the functionality of the CustomHashMap with String keys and Integer values.voidTests the functionality of the CustomHashMap with String keys and String values.
-
Constructor Details
-
CustomHashMapTester
public CustomHashMapTester()
-
-
Method Details
-
runAllTests
public void runAllTests()Runs all the test in this class along with the performance comparison tests. -
testStringIntegerMap
public void testStringIntegerMap()Tests the functionality of the CustomHashMap with String keys and Integer values. -
testIntegerDoubleMap
public void testIntegerDoubleMap()Tests the functionality of the CustomHashMap with Integer keys and Double values. -
testStringStringMap
public void testStringStringMap()Tests the functionality of the CustomHashMap with String keys and String values. -
performanceComparison
public void performanceComparison()Calls the performance comparison method for different sizes of data. -
performanceComparisonWithSize
public void performanceComparisonWithSize(int size) Compares the performance of the CustomHashMap to the Java HashMap for a given size of data. It measures the time taken for initialization, insertion, retrieval, and deletion operations for both maps and prints the results.- Parameters:
size- the size of data to be used for the performance comparison
-