Package es.upm.etsisi.cf4j.util.process
Interface Partible<T>
-
- All Known Implementing Classes:
AdjustedCosine
,AdjustedCosine
,CJMSD
,Correlation
,Correlation
,CorrelationConstrained
,CorrelationConstrained
,Cosine
,Cosine
,ItemSimilarityMetric
,Jaccard
,Jaccard
,JMSD
,JMSD
,MSD
,MSD
,PIP
,PIP
,Singularities
,Singularities
,SpearmanRank
,SpearmanRank
,UserSimilarityMetric
public interface Partible<T>
This interface handles the parallel execution of an array of T thorough Parallelizer class. Each execution of a Partible consists in three methods:- beforeRun(): is executed once before the execution of all the indices
- run(T object): is executed once per each object in the array of objects passed as parameter in the exec method of the Parallelizer class. These executions are performed in a parallel way
- afterRun(): is executed once after the execution of all the indices
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
afterRun()
Is executed once after execute the method exec.void
beforeRun()
Is executed once before execute the method 'exec'.void
run(T object)
Is executed once for each object in the array of objects passed as parameter in the exec method of the Parallelizer class.
-
-
-
Method Detail
-
beforeRun
void beforeRun()
Is executed once before execute the method 'exec'. It can be used to initialize resources.
-
run
void run(T object)
Is executed once for each object in the array of objects passed as parameter in the exec method of the Parallelizer class. These executions are performed in a parallel way. Race conditions must be handle by the developer. This method is no thread safe.- Parameters:
object
- Index of the test element.
-
afterRun
void afterRun()
Is executed once after execute the method exec. It can be used to close resources.
-
-