Package com.e1c.langtool.collector
Class ProjectMultiThreadCollectingOperation.Builder
java.lang.Object
com.e1c.langtool.collector.ProjectMultiThreadCollectingOperation.Builder
- Enclosing class:
- ProjectMultiThreadCollectingOperation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbeforeOperationRun(Runnable beforeOperationRun) Operation may run some call before multi-thread collecting.beforeOperationTaskName(String beforeOperationTaskName) Task name of the operation that starts on project scanning resource and collect files that need to process.build()Builds new operation with set parameters.collectingService(IFeatureValueCollectingService collectingService) Set collecting service that will use for multi-thread access.New builder to configure operation.operationTaskName(String operationTaskName) Customize Operation main task name.parameters(ICollectingParameters parameters) The collecting parameters.project(org.eclipse.core.resources.IProject project) Project to collect files from.subTaskName(BiFunction<Long, Long, String> subTaskName) Sub task name function where fist calling parameter is current processed number of files, and the second is total number of files submitted in pool queue.threadKeepAliveTime(Duration threadKeepAliveTime) Customize Thread-pool behavior that keeps thread alive some time after task queue is empty.threadNamePrefix(String threadNamePrefix) Thread name prefix of multi-thread access pool after which will append the number of the thread in pool.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
newBuilder
New builder to configure operation.
It is mandatory to callproject(IProject)to setup current project andbuild()to finish configuration. It is recommended to callcollectingService(IFeatureValueCollectingService)andparameters(ICollectingParameters)for basic settings.- Returns:
- the builder, cannot return
null.
-
build
Builds new operation with set parameters.- Returns:
- the project multi thread collecting operation, cannot return
null.
-
collectingService
public ProjectMultiThreadCollectingOperation.Builder collectingService(IFeatureValueCollectingService collectingService) Set collecting service that will use for multi-thread access.- Parameters:
collectingService- the collecting service, cannot benull.- Returns:
- the builder, cannot return
null.
-
beforeOperationTaskName
public ProjectMultiThreadCollectingOperation.Builder beforeOperationTaskName(String beforeOperationTaskName) Task name of the operation that starts on project scanning resource and collect files that need to process. Default value is:"Collecting strings from: <ProjectName>"- Parameters:
beforeOperationTaskName- the before operation task name, cannot benull.- Returns:
- the builder, cannot return
null.
-
beforeOperationRun
public ProjectMultiThreadCollectingOperation.Builder beforeOperationRun(Runnable beforeOperationRun) Operation may run some call before multi-thread collecting.- Parameters:
beforeOperationRun- the before operation run, cannot benull.- Returns:
- the builder, cannot return
null.
-
operationTaskName
Customize Operation main task name. Default value is:"Collecting strings from: <ProjectName>"- Parameters:
operationTaskName- the operation task name, cannot benull.- Returns:
- the builder, cannot return
null.
-
threadKeepAliveTime
public ProjectMultiThreadCollectingOperation.Builder threadKeepAliveTime(Duration threadKeepAliveTime) Customize Thread-pool behavior that keeps thread alive some time after task queue is empty. Default value is: 10 seconds.- Parameters:
threadKeepAliveTime- the thread keep alive time, cannot benull.- Returns:
- the builder, cannot return
null.
-
threadNamePrefix
Thread name prefix of multi-thread access pool after which will append the number of the thread in pool. Default value is:"Project-string-collector-(ProjectName)-"- Parameters:
threadNamePrefix- the thread name prefix, cannot benull.- Returns:
- the builder, cannot return
null.
-
subTaskName
public ProjectMultiThreadCollectingOperation.Builder subTaskName(BiFunction<Long, Long, String> subTaskName) Sub task name function where fist calling parameter is current processed number of files, and the second is total number of files submitted in pool queue. Default value is: format message for"files {0} of {1}".- Parameters:
subTaskName- the sub task name, cannot benull.- Returns:
- the builder, cannot return
null.
-
parameters
The collecting parameters.- Parameters:
parameters- the parameters, cannot benull.- Returns:
- the builder, cannot return
null.
-
project
public ProjectMultiThreadCollectingOperation.Builder project(org.eclipse.core.resources.IProject project) Project to collect files from.- Parameters:
project- the project, cannot benull.- Returns:
- the builder, cannot return
null.
-