|
Orbital library | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AlgorithmicTemplate
Base interface for algorithmic template frameworks.
An algorithmic template is a class that implements a problem-solving algorithm in a
general way, such that it is applicable in a multitude of different problems with the same
essential structure. It solves this whole bunch of problems by providing a maximum of methods
with shared behaviour, and deferring the problem-specific part into a problem interface.
Each algorithmic template class has an associated hook interface which is a sub-interface of
AlgorithmicProblem
and declares the wholes to fill.
So this hook interface will contain the part that distinguishes two individual problems of the
same common structure solved by the algorithmic template class.
In short, algorithmic templates decouple algorithms from the problems such that they the
solution procedure is independent of the specific problem at hand. They determine how
instances of the problem are solved in general, perhaps still providing some additional
parameters for adjusting the concrete problem solving approach.
Of course, algorithmic templates are more useful if they only require a very small and almost declarative algorithmic problem hook.
AlgorithmicProblem
,
≈StrategyNested Class Summary | |
---|---|
static class |
AlgorithmicTemplate.Configuration
Default implementation of algorithmic configuration objects. |
Method Summary | |
---|---|
Function |
complexity()
Measure for the asymptotic time complexity of the central solution operation in O-notation. |
java.lang.Object |
solve(AlgorithmicProblem p)
Generic solve method for a given algorithmic problem. |
Function |
spaceComplexity()
Measure for the asymptotic space complexity of the central solution operation in O-notation. |
Method Detail |
---|
java.lang.Object solve(AlgorithmicProblem p)
p
- algorithmic problem hook class which must fit the concrete
algorithmic template framework implementation.
Function.apply(Object)
Function complexity()
solve(AlgorithmicProblem)
Function spaceComplexity()
solve(AlgorithmicProblem)
|
Orbital library 1.3.0: 11 Apr 2009 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |