There are 4 code examples for java.util.concurrent.ThreadPoolExecutor.
The API names are highlighted below.
You can use
button
to vote the code example(s) you like. The best code example will be ranked first next time. Thanks a lot for your feedback.
Project Name: weka Package: weka.classifiers
Source Code: ParallelMultipleClassifiersCombiner.java (Click to view .java file)
Method Code:
/**
* Records the completion of the training of a single classifier. Unblocks if
* all classifiers have been trained.
* @param iteration the iteration that has completed
* @param success whether the classifier trained successfully
*/
protected synchronized void completedClassifier(int iteration,boolean success){
if (!success) {
m_failed++;
if (m_Debug) {
System.err.println("Iteration " + iteration + " failed!");
}
}
else {
m_completed++;
}
if (m_completed + m_failed == m_Classifiers.length) {
if (m_failed > 0) {
if (m_Debug) {
System.err.println("Problem building classifiers - some iterations failed.");
}
}
m_executorPool.shutdown();
block(false);
}
}
Project Name: weka Package: weka.classifiers
Source Code: ParallelIteratedSingleClassifierEnhancer.java (Click to view .java file)
Method Code:
/**
* Records the completion of the training of a single classifier. Unblocks if
* all classifiers have been trained.
* @param iteration the iteration that has completed
* @param success whether the classifier trained successfully
*/
protected synchronized void completedClassifier(int iteration,boolean success){
if (!success) {
m_failed++;
if (m_Debug) {
System.err.println("Iteration " + iteration + " failed!");
}
}
else {
m_completed++;
}
if (m_completed + m_failed == m_Classifiers.length) {
if (m_failed > 0) {
if (m_Debug) {
System.err.println("Problem building classifiers - some iterations failed.");
}
}
m_executorPool.shutdown();
block(false);
}
}
Project Name: weka Package: weka.gui.beans
Source Code: Classifier.java (Click to view .java file)
Method Code:
/**
* Returns true if. at this time, the bean is busy with some
* (i.e. perhaps a worker thread is performing some calculation).
* @return true if the bean is busy.
*/
public boolean isBusy(){
if (m_executorPool == null || (m_executorPool.getQueue().size() == 0 && m_executorPool.getActiveCount() == 0) && m_state == IDLE) {
return false;
}
return true;
}
Project Name: weka Package: weka.gui.beans
Source Code: ClassifierPerformanceEvaluator.java (Click to view .java file)
Method Code:
/**
* Return an enumeration of user activated requests for this bean
* @return an <code>Enumeration</code> value
*/
public Enumeration enumerateRequests(){
Vector newVector=new Vector(0);
if (m_executorPool != null && (m_executorPool.getQueue().size() > 0 || m_executorPool.getActiveCount() > 0)) {
newVector.addElement("Stop");
}
return newVector.elements();
}