public class Fast2014DagImpl extends LatestDagBase
IDag.EventNotifierAccessor
Modifier and Type | Field and Description |
---|---|
private FormDef.EvalBehavior |
mode |
accessor, conditionRepeatTargetIndex, triggerablesDAG, triggerIndex, unorderedTriggerables
Constructor and Description |
---|
Fast2014DagImpl(IDag.EventNotifierAccessor accessor) |
Modifier and Type | Method and Description |
---|---|
private void |
addChildrenOfElement(FormInstance mainInstance,
EvaluationContext evalContext,
TreeElement el,
java.util.Set<TreeReference> toAdd,
boolean expandRepeatables) |
void |
addChildrenOfReference(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference original,
java.util.Set<TreeReference> toAdd,
boolean expandRepeatables)
This is a utility method to get all of the references of a node.
|
void |
copyItemsetAnswer(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference copyRef,
TreeElement copyToElement,
boolean midSurvey)
Take actions related to changes of select-one and select-multiple
itemsets.
|
void |
createRepeatGroup(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference createRef,
TreeElement parentElement,
TreeElement createdElement)
Take whatever action is required when creating a repeat group.
|
void |
deleteRepeatGroup(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference deleteRef,
TreeElement parentElement,
TreeElement deletedElement)
Take whatever action is required when deleting a repeat group.
|
private void |
evaluateChildrenTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeElement newNode,
boolean createdOrDeleted,
boolean midSurvey,
java.util.Set<QuickTriggerable> alreadyEvaluated) |
private java.util.Set<QuickTriggerable> |
evaluateTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
java.util.Set<QuickTriggerable> tv,
TreeReference anchorRef,
boolean midSurvey,
java.util.Set<QuickTriggerable> alreadyEvaluated)
Step 2 in evaluating DAG computation updates from a value being changed
in the instance.
|
void |
fillTriggeredElements(FormInstance mainInstance,
EvaluationContext evalContext,
QuickTriggerable qt,
java.util.Set<QuickTriggerable> destinationSet,
java.util.Set<QuickTriggerable> newDestinationSet,
boolean midSurvey)
Get all of the elements which will need to be evaluated (in order) when
the triggerable is fired.
|
void |
finalizeTriggerables(FormInstance mainInstance,
EvaluationContext evalContext)
Finalize the DAG associated with the form's triggered conditions.
|
FormDef.EvalBehavior |
getEvalBehavior()
The EvalBehavior that the implementation provides.
|
QuickTriggerable |
getTriggerableForRepeatGroup(TreeReference repeatRef)
Used to obtain the triggerable that impacts the relevancy of the repeat
group.
|
java.util.Collection<QuickTriggerable> |
initializeTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference rootRef,
boolean midSurvey)
Walks the current set of conditions, and evaluates each of them with the
current context.
|
private java.util.Set<QuickTriggerable> |
initializeTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference rootRef,
boolean midSurvey,
java.util.Set<QuickTriggerable> alreadyEvaluated) |
boolean |
shouldTrustPreviouslyCommittedAnswer()
Specifies if unchanged answers should be trusted (and not re-committed).
|
java.util.Collection<QuickTriggerable> |
triggerTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference ref,
boolean midSurvey)
The entry point for the DAG cascade after a value is changed in the
model.
|
private java.util.Set<QuickTriggerable> |
triggerTriggerables(FormInstance mainInstance,
EvaluationContext evalContext,
TreeReference ref,
boolean midSurvey,
java.util.Set<QuickTriggerable> alreadyEvaluated) |
doEvaluateTriggerables
addTriggerable, getConditionExpressionForTrueAction, getConditions, getRecalculates, printTriggerables, publishSummary, publishSummary, reportDependencyCycles, validate
private final FormDef.EvalBehavior mode
public Fast2014DagImpl(IDag.EventNotifierAccessor accessor)
public FormDef.EvalBehavior getEvalBehavior()
IDag
getEvalBehavior
in class IDag
public QuickTriggerable getTriggerableForRepeatGroup(TreeReference repeatRef)
IDag
getTriggerableForRepeatGroup
in class IDag
public void deleteRepeatGroup(FormInstance mainInstance, EvaluationContext evalContext, TreeReference deleteRef, TreeElement parentElement, TreeElement deletedElement)
IDag
deleteRepeatGroup
in class IDag
public void createRepeatGroup(FormInstance mainInstance, EvaluationContext evalContext, TreeReference createRef, TreeElement parentElement, TreeElement createdElement)
IDag
createRepeatGroup
in class IDag
private void evaluateChildrenTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeElement newNode, boolean createdOrDeleted, boolean midSurvey, java.util.Set<QuickTriggerable> alreadyEvaluated)
public void copyItemsetAnswer(FormInstance mainInstance, EvaluationContext evalContext, TreeReference copyRef, TreeElement copyToElement, boolean midSurvey)
IDag
copyItemsetAnswer
in class IDag
public void finalizeTriggerables(FormInstance mainInstance, EvaluationContext evalContext) throws java.lang.IllegalStateException
finalizeTriggerables
in class IDag
java.lang.IllegalStateException
- - If the trigger ordering contains an illegal cycle and the
triggers can't be laid out appropriatelypublic void fillTriggeredElements(FormInstance mainInstance, EvaluationContext evalContext, QuickTriggerable qt, java.util.Set<QuickTriggerable> destinationSet, java.util.Set<QuickTriggerable> newDestinationSet, boolean midSurvey)
qt
- destinationSet
- where to store the triggerablesmidSurvey
- if true, then the slow code will execute, if false, then
old/fast code will execute that suffers from
https://code.google.com/p/opendatakit/issues/detail?id=888private java.util.Set<QuickTriggerable> evaluateTriggerables(FormInstance mainInstance, EvaluationContext evalContext, java.util.Set<QuickTriggerable> tv, TreeReference anchorRef, boolean midSurvey, java.util.Set<QuickTriggerable> alreadyEvaluated)
tv
- A set of all of the trigerrables directly triggered by the
value changedanchorRef
- public void addChildrenOfReference(FormInstance mainInstance, EvaluationContext evalContext, TreeReference original, java.util.Set<TreeReference> toAdd, boolean expandRepeatables)
private void addChildrenOfElement(FormInstance mainInstance, EvaluationContext evalContext, TreeElement el, java.util.Set<TreeReference> toAdd, boolean expandRepeatables)
public java.util.Collection<QuickTriggerable> initializeTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference rootRef, boolean midSurvey)
initializeTriggerables
in class IDag
midSurvey
- true if we are during the survey, false if we are on loading/saving phaseprivate java.util.Set<QuickTriggerable> initializeTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference rootRef, boolean midSurvey, java.util.Set<QuickTriggerable> alreadyEvaluated)
public java.util.Collection<QuickTriggerable> triggerTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference ref, boolean midSurvey)
triggerTriggerables
in class IDag
ref
- The full contextualized unambiguous reference of the value
that was changed.private java.util.Set<QuickTriggerable> triggerTriggerables(FormInstance mainInstance, EvaluationContext evalContext, TreeReference ref, boolean midSurvey, java.util.Set<QuickTriggerable> alreadyEvaluated)
public boolean shouldTrustPreviouslyCommittedAnswer()
IDag
shouldTrustPreviouslyCommittedAnswer
in class IDag