Class HashMapTestResultCache
- java.lang.Object
-
- de.rwth.swc.coffee4j.algorithmic.sequential.manager.HashMapTestResultCache
-
- All Implemented Interfaces:
TestResultCache
public class HashMapTestResultCache extends Object implements TestResultCache
Stores test results is a hash map.
-
-
Constructor Summary
Constructors Constructor Description HashMapTestResultCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResultFor(IntArrayWrapper testInput, TestResult result)Adds a result to the cache so it may later be retrieved viaTestResultCache.getResultFor(IntArrayWrapper).booleancontainsResultFor(IntArrayWrapper testInput)TestResultgetResultFor(IntArrayWrapper testInput)
-
-
-
Method Detail
-
containsResultFor
public boolean containsResultFor(IntArrayWrapper testInput)
- Specified by:
containsResultForin interfaceTestResultCache- Parameters:
testInput- for which a result could be needed. Must not benull- Returns:
- Whether the cache contains the result of the given test input
-
getResultFor
public TestResult getResultFor(IntArrayWrapper testInput)
- Specified by:
getResultForin interfaceTestResultCache- Parameters:
testInput- for which the result is needed. Must not benull- Returns:
- the result of the given test input. If
TestResultCache.containsResultFor(IntArrayWrapper)returnsfalsefor this test input, the behavior is not defined and depends on the actual implementation
-
addResultFor
public void addResultFor(IntArrayWrapper testInput, TestResult result)
Description copied from interface:TestResultCacheAdds a result to the cache so it may later be retrieved viaTestResultCache.getResultFor(IntArrayWrapper). After a testInput has been added here,TestResultCache.containsResultFor(IntArrayWrapper)should returnedtrueif called for the same testInput.- Specified by:
addResultForin interfaceTestResultCache- Parameters:
testInput- for which the result should be savedresult- of the test input
-
-