|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.dfki.lt.sdl.Mediators
public class Mediators
this is the default (super)class of the three mediators o seq: sequence or concatenation, o par: parallelism or concurrency, o fix: fixpoint or unrestricted iteration, providing some default behavior; I originaly thought that this functionality (without the trival default sequence mediator) had to be part of the module interface; however, a module should usually NOT know what a fixpoint is (in case of module iteration); moreover, when moving the mediators into the module interface, an asymmetry for the parallelism pattern will occur; NOTE: the mediators do NOT set the input NOR the output of their module parameters!! note that in case we want to have specific mediators for certain modules/ module combinations, we can easily achieve this by providing additional instance methods with different signatures in subclasses of Mediators
IMediator
,
IModule
,
Modules
Constructor Summary | |
---|---|
Mediators()
no functionality in this constructor, only needed to call specialized instance mediators |
Method Summary | |
---|---|
java.lang.Object |
fix(IModule module)
the fixpoint mediator checks whether the application of the unary module method run() to the input is equivalent to the result value; if not, it calls run() on the output again, until a fixpoint has been reached (which must, of course, not exist, i.e., the computation must not terminate); note that this default method assumes that input AND output of a module are of the same data type and that the equals() method on the type of input/output works properly; in order to guarantee this, the compareTo() and the equals() method of elements in a structured input/output must also work properly, perhaps even the hashCode() method; note further that fix() does NOT set the input NOR the output of the module!! |
java.lang.Object |
par(IModule[] modules)
the default parallelism mediator simply groups the output of the modules in an array (of length equals to the number of incoming modules) |
java.lang.Object |
seq(IModule module1,
IModule module2)
the implemented default behavior for the sequence mediator is identity, returning the output of module1 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Mediators()
Method Detail |
---|
public java.lang.Object seq(IModule module1, IModule module2)
seq
in interface IMediator
for a possible implementation
public java.lang.Object par(IModule[] modules)
par
in interface IMediator
for a possible implementation
public java.lang.Object fix(IModule module)
fix
in interface IMediator
for a possible implementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |