public interface ProposedExpressionAnalyser
Blackboard
by analysing
EvaluableExpressions. This analyser can use
measurement results and already proposed EvaluableExpressions to propose new EvaluableExpressions. Analysers that only use measurement results should implement
MeasurementResultAnalyser
instead of this interface. For more details, look for
the Blackboard layers in the Design and Architecture document in chapter 2. Tools
wishing to conduct measurements on software are advised to implement
MeasurementTool
instead of this
interface.
Proposed expression analysers need a public zero argument constructor for the instantiation, because they are loaded through eclipse extension points.
Modifier and Type | Method and Description |
---|---|
boolean |
canContribute(ReadOnlyProposedExpressionAnalyserBlackboardView blackboard)
Determines whether this analyser can potentially contribute knowledge in the
moment.
|
void |
contribute(ProposedExpressionAnalyserBlackboardView blackboard)
Contributes this analyser’s knowledge to the passed blackboard.
|
boolean canContribute(ReadOnlyProposedExpressionAnalyserBlackboardView blackboard)
true
is returned, the analyser can potentially contribute, but
might still be unable to generate meaningful results when being executed. If
false
is returned, calling contribute(de.uka.ipd.sdq.beagle.core.analysis.ProposedExpressionAnalyserBlackboardView)
will not yield any new
results. Calling this method has no implications on whether or when
contribute(de.uka.ipd.sdq.beagle.core.analysis.ProposedExpressionAnalyserBlackboardView)
will be called. Passing a blackboard
that was last
modified by this analyser’s contribute(de.uka.ipd.sdq.beagle.core.analysis.ProposedExpressionAnalyserBlackboardView)
must always result in false
.
This method must behave entirely stateless, meaning that its result do not
depend on any prior calls to any method but only on the passed blackboard
.
Furthermore, calls with equal blackboard contents must always result in the same
value.
blackboard
- The current blackboard.true
only if contribute(de.uka.ipd.sdq.beagle.core.analysis.ProposedExpressionAnalyserBlackboardView)
may be called.void contribute(ProposedExpressionAnalyserBlackboardView blackboard)
Calling this method with a blackboard for which canContribute(de.uka.ipd.sdq.beagle.core.analysis.ReadOnlyProposedExpressionAnalyserBlackboardView)
returns
false
results in undefined behaviour. This method must
canContribute(de.uka.ipd.sdq.beagle.core.analysis.ReadOnlyProposedExpressionAnalyserBlackboardView)
) but only on the passed
blackboard
.
blackboard
.
canContribute(de.uka.ipd.sdq.beagle.core.analysis.ReadOnlyProposedExpressionAnalyserBlackboardView)
is called with the blackboard like its
left by this method, it will return false
.
Implementing BlackboardStorer
and using
Blackboard.writeFor(Class, java.io.Serializable)
is, if needed, the recommended way to achieve the behaviour described above.
blackboard
- The current blackboard.