public abstract class AnalyzableElementsProcessingTask<IE extends IAnalyzableElement,PE extends IAnalyzableElement>
extends java.lang.Object
implements java.lang.Runnable
IE = Initiating Element type
PE = Processing Element type
Modifier | Constructor and Description |
---|---|
protected |
AnalyzableElementsProcessingTask(java.lang.String type,
IProgressMonitor monitor,
IElementsProcessingResultHandler resultHandler) |
Modifier and Type | Method and Description |
---|---|
protected java.util.Collection<PE> |
createInitialExcludeCollection()
Returns a collection with elements that should be excluded.
|
protected ProcessingResult<PE> |
createResult(java.util.Collection<PE> collectedElements)
Returns a new result object based on the given result collection.
|
protected abstract boolean |
doProcessing(java.util.Collection<PE> result)
Does the processing over the workset's elements.
|
protected abstract IMutableAnalyzableElementProcessor<PE> |
getElementProcessor()
Returns the processor that processes and matches the elements given to it.
|
protected java.lang.String |
getProcessingType() |
protected IProgressMonitor |
getProgressMonitor() |
protected IElementsProcessingResultHandler |
getResultHandler() |
protected abstract IE |
getStartElement()
Returns the element on which the processing gets executed.
|
protected Workset |
getWorkset()
Returns the workset or the analyzed element.
|
protected boolean |
hasProgressMonitor() |
boolean |
isRecursiveProcessing() |
protected java.util.Collection<PE> |
newResultCollection()
Creates a new result collection.
|
protected boolean |
recursiveProcessing(java.util.Collection<PE> excludes,
java.util.Collection<PE> result)
Executes the processing over the workset's elements for the start element
and afterwards for all found elements recursively until no new one was found.
|
void |
run()
Executes the whole processing.
|
void |
setIsRecursiveProcessing(boolean newValue) |
protected void |
setProcessingType(java.lang.String newValue) |
protected void |
setProgressMonitor(IProgressMonitor newValue) |
protected void |
setResultHandler(IElementsProcessingResultHandler newValue) |
protected AnalyzableElementsProcessingTask(java.lang.String type, IProgressMonitor monitor, IElementsProcessingResultHandler resultHandler)
type
- A unique identifier for the processing task. It will be passed to the resultHandler to identify the process.monitor
- An optional monitor that can show the progress (may be null).resultHandler
- The object that will be called to receive the result when the thread is finished.public void run()
run
in interface java.lang.Runnable
public boolean isRecursiveProcessing()
public void setIsRecursiveProcessing(boolean newValue)
protected abstract IE getStartElement()
protected abstract boolean doProcessing(java.util.Collection<PE> result)
protected abstract IMutableAnalyzableElementProcessor<PE> getElementProcessor()
protected boolean recursiveProcessing(java.util.Collection<PE> excludes, java.util.Collection<PE> result)
protected Workset getWorkset()
protected ProcessingResult<PE> createResult(java.util.Collection<PE> collectedElements)
protected java.util.Collection<PE> createInitialExcludeCollection()
protected java.util.Collection<PE> newResultCollection()
protected boolean hasProgressMonitor()
protected java.lang.String getProcessingType()
protected void setProcessingType(java.lang.String newValue)
protected IProgressMonitor getProgressMonitor()
protected void setProgressMonitor(IProgressMonitor newValue)
protected IElementsProcessingResultHandler getResultHandler()
protected void setResultHandler(IElementsProcessingResultHandler newValue)