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 void
addResultFor(IntArrayWrapper testInput, TestResult result)
Adds a result to the cache so it may later be retrieved viaTestResultCache.getResultFor(IntArrayWrapper)
.boolean
containsResultFor(IntArrayWrapper testInput)
TestResult
getResultFor(IntArrayWrapper testInput)
-
-
-
Method Detail
-
containsResultFor
public boolean containsResultFor(IntArrayWrapper testInput)
- Specified by:
containsResultFor
in 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:
getResultFor
in interfaceTestResultCache
- Parameters:
testInput
- for which the result is needed. Must not benull
- Returns:
- the result of the given test input. If
TestResultCache.containsResultFor(IntArrayWrapper)
returnsfalse
for 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:TestResultCache
Adds 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 returnedtrue
if called for the same testInput.- Specified by:
addResultFor
in interfaceTestResultCache
- Parameters:
testInput
- for which the result should be savedresult
- of the test input
-
-