I
- the class of a job ID for this engine.R
- the result class.public abstract class Engine<I extends Comparable<I>,R> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Engine.CalculationResult<I,R>
This is a helper class to store results of parallel computations.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_NUMBER_OF_THREADS |
Constructor and Description |
---|
Engine(Class<I> identClass,
Class<R> resultClass) |
Modifier and Type | Method and Description |
---|---|
void |
addTask(I ident)
Adds the task with the given identifier to this Engine.
|
void |
addTasks(Collection<I> idents)
Adds the tasks with the given identifiers to this Engine.
|
void |
addTasks(I[] idents)
Adds the tasks with the given identifiers to this Engine.
|
void |
calculate()
Starts the actual, parallel computation.
|
void |
clearTasks()
Removes all tasks from this Engine.
|
abstract Callable<R> |
createCallable(I ident)
A method that should create a Callable (computation job) for the given
identifier object.
|
Collection<Engine.CalculationResult<I,R>> |
getResults()
Returns the results of this Engines last computation.
|
void |
removeTask(I ident)
Removes the task with the given identifier from this Engine.
|
void |
removeTasks(Collection<I> idents)
Removes the tasks with the given identifiers from this Engine.
|
void |
removeTasks(I[] idents)
Removes the tasks with the given identifiers from this Engine.
|
public static final int DEFAULT_NUMBER_OF_THREADS
public abstract Callable<R> createCallable(@NonNull I ident)
ident
- an identifier.public void addTask(@NonNull I ident)
ident
- an identifier.public void addTasks(@NonNull I[] idents)
idents
- some identifiers.public void addTasks(@NonNull Collection<I> idents)
idents
- some identifiers.public void clearTasks()
public void removeTask(@NonNull I ident)
ident
- an identifier.public void removeTasks(@NonNull I[] idents)
idents
- some identifiers.public void removeTasks(@NonNull Collection<I> idents)
idents
- some identifiers.public void calculate()
public Collection<Engine.CalculationResult<I,R>> getResults()
Copyright (C) 2016 Benjamin Paaßen, AG Theoretical Computer Science, Centre of Excellence Cognitive Interaction Technology (CITEC), University of Bielefeld, licensed under the AGPL v. 3: http://openresearch.cit-ec.de/projects/tcs . This documentation is licensed under the conditions of CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/