Class SimpleSimilarityCacheMatrix
java.lang.Object
de.uni_trier.wi2.procake.adaptation.cache.AbstractSimilarityCacheMatrix
de.uni_trier.wi2.procake.adaptation.cache.impl.SimpleSimilarityCacheMatrix
- All Implemented Interfaces:
Serializable
SimpleSimilarityCacheMatrix class.
- See Also:
-
Field Summary
Fields inherited from class de.uni_trier.wi2.procake.adaptation.cache.AbstractSimilarityCacheMatrix
cleanSimilarityMatrix, dirtySimilarityMatrix, logger, serialVersionUID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDirtyCase
(String queryID, String caseID, Similarity similarity) Adds a case to the dirty matrix.void
This method reads a similarity cache matrix from disk.void
removeCase
(String caseID) Removes the case with the given ID from the similarity cache matrix.void
This method writes out the dirty similarity cache to disk.Methods inherited from class de.uni_trier.wi2.procake.adaptation.cache.AbstractSimilarityCacheMatrix
addDirtySimilarity, getCases, getSimilarity, hasSimilarity, print, size
-
Constructor Details
-
SimpleSimilarityCacheMatrix
public SimpleSimilarityCacheMatrix()
-
-
Method Details
-
addDirtyCase
Adds a case to the dirty matrix. This means that this similarity is not serialized to disk, yet.- Specified by:
addDirtyCase
in classAbstractSimilarityCacheMatrix
- Parameters:
queryID
- the ID of the querycaseID
- the ID of the casesimilarity
- the similarity object
-
removeCase
Removes the case with the given ID from the similarity cache matrix.- Specified by:
removeCase
in classAbstractSimilarityCacheMatrix
- Parameters:
caseID
- the ID of the case to remove
-
readCleanSimilarityCacheMatrix
This method reads a similarity cache matrix from disk.- Specified by:
readCleanSimilarityCacheMatrix
in classAbstractSimilarityCacheMatrix
- Parameters:
path
- the path to read from
-
writeDirtySimilarityCacheMatrix
This method writes out the dirty similarity cache to disk. In this process, the matrix is temporarily locked for further access and after the serialization, the similarities are copied to the clean matrix.- Specified by:
writeDirtySimilarityCacheMatrix
in classAbstractSimilarityCacheMatrix
- Parameters:
path
- the path to write to
-