T - The type of objects which will be created from this task.D - A result objects type.public abstract class AbstractRecursivConverterTask<T,D>
extends java.util.concurrent.RecursiveTask<java.util.Set<T>>
RecursiveTask and takes a
ConcurrentLinkedQueue of D. It splits the elements to process
on instances of it self based on the crawler configuration and calls the
this#processElement(Object)) for each.| Modifier and Type | Field and Description |
|---|---|
protected MediathekReader |
crawler
The crawler which this task is for.
|
protected java.util.Set<T> |
taskResults
The set of results.
|
| Constructor and Description |
|---|
AbstractRecursivConverterTask(MediathekReader aCrawler,
java.util.concurrent.ConcurrentLinkedQueue<D> aUrlToCrawlDTOs) |
| Modifier and Type | Method and Description |
|---|---|
protected java.util.Set<T> |
compute() |
protected abstract AbstractRecursivConverterTask<T,D> |
createNewOwnInstance(java.util.concurrent.ConcurrentLinkedQueue<D> aElementsToProcess)
In this method you just have to create a new instance of yourself.
|
protected abstract java.lang.Integer |
getMaxElementsToProcess() |
protected abstract void |
processElement(D aElement)
In this method you have to use the element
D to create a object of
the return type T. |
adapt, adapt, adapt, cancel, compareAndSetForkJoinTaskTag, complete, completeExceptionally, fork, get, get, getException, getForkJoinTaskTag, getPool, getQueuedTaskCount, getSurplusQueuedTaskCount, helpQuiesce, inForkJoinPool, invoke, invokeAll, invokeAll, invokeAll, isCancelled, isCompletedAbnormally, isCompletedNormally, isDone, join, peekNextLocalTask, pollNextLocalTask, pollTask, quietlyComplete, quietlyInvoke, quietlyJoin, reinitialize, setForkJoinTaskTag, tryUnforkprotected transient MediathekReader crawler
protected transient java.util.Set<T> taskResults
public AbstractRecursivConverterTask(MediathekReader aCrawler, java.util.concurrent.ConcurrentLinkedQueue<D> aUrlToCrawlDTOs)
protected java.util.Set<T> compute()
compute in class java.util.concurrent.RecursiveTask<java.util.Set<T>>protected abstract AbstractRecursivConverterTask<T,D> createNewOwnInstance(java.util.concurrent.ConcurrentLinkedQueue<D> aElementsToProcess)
aElementsToProcess - The ConcurrentLinkedQueue of D
the new instance should process.protected abstract java.lang.Integer getMaxElementsToProcess()
protected abstract void processElement(D aElement)
D to create a object of
the return type T. Add the results to taskResults.aElement - A element to be processed.