Class SimilarityCacheMatrix
java.lang.Object
de.uni_trier.wi2.procake.adaptation.cache.AbstractSimilarityCacheMatrix
de.uni_trier.wi2.procake.adaptation.cache.impl.SimilarityCacheMatrix
- All Implemented Interfaces:
Serializable
This class administrates the cached similarities within a similarity matrix.
- Author:
- Gilbert Mueller, Maximilian Hoffmann
- 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.getMapping
(String queryId, String caseId) getMapping.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
-
SimilarityCacheMatrix
public SimilarityCacheMatrix()
-
-
Method Details
-
getMapping
getMapping.
-
addDirtyCase
Adds a case to the dirty matrix. This means that this similarity is not serialized to disk, yet.This method has to be synchronized!
- 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
-