Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /* *********************************************************************
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0.
  * 
  * If a copy of the MPL was not distributed with this file, You can obtain
  * one at http://mozilla.org/MPL/2.0/.
  * 
  * This Source Code Form is "Incompatible With Secondary Licenses", as
  * defined by the Mozilla Public License, v. 2.0.
 * ********************************************************************* */
package fiftyone.mobile.detection.matchers;
Super class that all matchers inherit from.

Author(s):
51Degrees.mobi
Version:
2.2.8.9
public abstract class Matcher {
    
    
Gets the number of threads the matcher should use with the ThreadPoolExecutor.

Parameters:
threadPool
Returns:
The number of threads to use.
    protected static int getThreadCount(ThreadPoolExecutor threadPool) {
        int poolSize = threadPool.getCorePoolSize();
        //int poolSize = threadPool.getPoolSize();
        if(poolSize == 0) {
            poolSize = 4;
        }
        return poolSize;
    }
    
New to GrepCode? Check out our FAQ X