ProcessorSettings

Inheritance: java.lang.Object

public class ProcessorSettings

ProcessorSettings allow to recognize barcodes with multi-threaded increasing of performance


This sample shows how to use ProcessorSettings to add maximum multi-threaded performnce
 
 BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount()* 2);
 //this allows to use all cores for single BarCodeReader call
 BarCodeReader.getProcessorSettings().setUseAllCores(true);
 //this allows to use current count of cores
 BarCodeReader.getProcessorSettings().setUseAllCores(false);
 BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));

Methods

MethodDescription
equals(Object arg0)
getClass()
getMaxAdditionalAllowedThreads()Specify the maximal number of additional threads to run code in parallel
getUseAllCores()Is needed to use all cores.
getUseOnlyThisCoresCount()Specify the number of cores to use.
hashCode()
notify()
notifyAll()
setMaxAdditionalAllowedThreads(int value)Specify the maximal number of additional threads to run code in parallel
setUseAllCores(boolean value)Is needed to use all cores.
setUseOnlyThisCoresCount(int value)Specify the number of cores to use.
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getMaxAdditionalAllowedThreads()

public int getMaxAdditionalAllowedThreads()

Specify the maximal number of additional threads to run code in parallel


BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount() * 2);

Returns: int

getUseAllCores()

public boolean getUseAllCores()

Is needed to use all cores.


BarCodeReader.getProcessorSettings().setUseAllCores(true);

Returns: boolean

getUseOnlyThisCoresCount()

public int getUseOnlyThisCoresCount()

Specify the number of cores to use. You need to change the property “UseAllCores” to “false”.


BarCodeReader.getProcessorSettings().setUseAllCores(false);
 BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));

Returns: int

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setMaxAdditionalAllowedThreads(int value)

public void setMaxAdditionalAllowedThreads(int value)

Specify the maximal number of additional threads to run code in parallel


BarCodeReader.getProcessorSettings().setMaxAdditionalAllowedThreads(Environment.getProcessorCount() * 2);

Parameters:

ParameterTypeDescription
valueint

setUseAllCores(boolean value)

public void setUseAllCores(boolean value)

Is needed to use all cores.


BarCodeReader.getProcessorSettings().setUseAllCores(true);

Parameters:

ParameterTypeDescription
valueboolean

setUseOnlyThisCoresCount(int value)

public void setUseOnlyThisCoresCount(int value)

Specify the number of cores to use. You need to change the property “UseAllCores” to “false”.


BarCodeReader.getProcessorSettings().setUseAllCores(false);
 BarCodeReader.getProcessorSettings().setUseOnlyThisCoresCount(Math.max(1, Environment.getProcessorCount() / 2));

Parameters:

ParameterTypeDescription
valueint

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int