|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.ocl.examples.impactanalyzer.instanceScope.unusedEvaluation.UnusedEvaluationRequestSet
public class UnusedEvaluationRequestSet
| Nested Class Summary | |
|---|---|
static class |
UnusedEvaluationRequestSet.UnusedEvaluationResult
If the result says that unused was proven, there won't be a new request set
delivered. |
| Method Summary | |
|---|---|
UnusedEvaluationRequestSet |
createReducedSet(java.util.Set<Variable> variablesThatLeaveOrEnterScope,
UnusedEvaluationRequestFactory unusedEvaluationRequestFactory)
Computes a new set of UnusedEvaluationRequests by copying all those requests not keyed by a
variable that entered or left scope. |
boolean |
equals(java.lang.Object obj)
|
static UnusedEvaluationRequestSet.UnusedEvaluationResult |
evaluate(java.util.Collection<UnusedEvaluationRequest> requestsToEvaluate,
OppositeEndFinder oppositeEndFinder,
TracebackCache tracebackCache,
OCLFactory oclFactory)
Evaluates the requestsToEvaluate. |
int |
hashCode()
|
UnusedEvaluationRequestSet |
merge(UnusedEvaluationRequestSet other)
Produces a new instance of this class whose requests map holds the combined sets of UnusedEvaluationRequests
from this and the other set. |
UnusedEvaluationRequestSet.UnusedEvaluationResult |
setVariable(Variable variable,
org.eclipse.emf.ecore.EObject value,
OppositeEndFinder oppositeEndFinder,
TracebackCache tracebackCache,
OCLFactory oclFactory)
Announces that the value for a variable was inferred. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object
public UnusedEvaluationRequestSet createReducedSet(java.util.Set<Variable> variablesThatLeaveOrEnterScope,
UnusedEvaluationRequestFactory unusedEvaluationRequestFactory)
UnusedEvaluationRequests by copying all those requests not keyed by a
variable that entered or left scope. Those requests whose unknown variable left or entered scope can't be inferred anymore
along this traceback chain. Therefore, we can remove their corresponding requests.
For all remaining requests, we remove the slots for any variable contained in variablesThatLeavOrEnterScope.
public UnusedEvaluationRequestSet.UnusedEvaluationResult setVariable(Variable variable,
org.eclipse.emf.ecore.EObject value,
OppositeEndFinder oppositeEndFinder,
TracebackCache tracebackCache,
OCLFactory oclFactory)
UnusedEvaluationRequests that have a slot for
this variable are cloned and the value inferred is stored in the cloned request. If the variable is the unknown variable
for any of the requests managed by this set, the request is re-evaluated. If the request evaluates to false,
it is silently removed from the new request set returned. If the request evaluates to true, further evaluation
is aborted immediately, and the method just returns the fact that one of the requests evaluated to true. If
the request evaluation fails due to an unknown variable, the request is returned in the
new request set keyed by the now unknown variable.
oclFactory - TODO
UnusedEvaluationRequestSet which may be this unchanged object in case no request had a slot for
the variable inferred, or a new set which contains the re-organized and possibly cloned requests.
public static UnusedEvaluationRequestSet.UnusedEvaluationResult evaluate(java.util.Collection<UnusedEvaluationRequest> requestsToEvaluate,
OppositeEndFinder oppositeEndFinder,
TracebackCache tracebackCache,
OCLFactory oclFactory)
requestsToEvaluate. If any of them returns true from its
UnusedEvaluationRequest#evaluate(OppositeEndFinder, OCL) method, a result will be returned that returns
true from its UnusedEvaluationRequestSet.UnusedEvaluationResult.hasProvenUnused() method. Otherwise, that result's method will
return false. If any request's evaluation failed for an unknown variable, the request will be added to a new
UnusedEvaluationRequestSet which is part of this method's result (see
UnusedEvaluationRequestSet.UnusedEvaluationResult.getNewRequestSet()), keyed by the unknown Variable.
requestsToEvaluate - may be null which will immediately cause the result to be a combination of false and a
new, empty UnusedEvaluationRequestSet.public UnusedEvaluationRequestSet merge(UnusedEvaluationRequestSet other)
requests map holds the combined sets of UnusedEvaluationRequests
from this and the other set.
other - may be null, which makes the method return this unchangedpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||