|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.util.ThreadedCaller
A class providing parallel execution of its method call(Object) (which has to be implemented in subclasses for an array of "targets". Targets can be arbitrary objects which are delivered to call(Object). The results are collected in a map.
Currently, the threaded calling is disabled, and sequential order is enabled.
| Field Summary | |
protected java.util.Map |
results
Map, containing all targets (as keys) and their results (as values). |
protected java.lang.Object[] |
targets
The targets. |
| Constructor Summary | |
ThreadedCaller(java.util.Iterator iterator)
Creates a new instance. |
|
ThreadedCaller(java.util.List list)
Creates a new instance. |
|
ThreadedCaller(java.lang.Object[] targets)
Creates a new instance. |
|
| Method Summary | |
abstract java.lang.Object |
call(java.lang.Object target)
The method performing the actual work for a target. |
java.lang.Object |
getResult(java.lang.Object target)
Returns the result object of the specified target. |
java.util.Map |
getResults()
Returns a map, containing all targets (as keys) and their results (as values). |
java.lang.Object[] |
getTargets()
Returns an array, containing all targets. |
java.util.Map |
start()
Starts the execution. |
java.util.Map |
start10()
Starts the parallel execution. 10 threads are used for handling the targets. |
java.util.Map |
startAll()
Starts the parallel execution. |
java.util.Map |
startSequential()
Starts the sequential execution, without creating new threads. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Map results
protected java.lang.Object[] targets
| Constructor Detail |
public ThreadedCaller(java.util.Iterator iterator)
iterator - iterator, producing all targetspublic ThreadedCaller(java.util.List list)
list - targetspublic ThreadedCaller(java.lang.Object[] targets)
targets - targets| Method Detail |
public abstract java.lang.Object call(java.lang.Object target)
Subclasses have to overwrite this method.
target - target for this call
public java.util.Map start()
public java.util.Map startAll()
public java.util.Map startSequential()
public java.util.Map start10()
public java.util.Map getResults()
public java.lang.Object getResult(java.lang.Object target)
target - target
public java.lang.Object[] getTargets()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||