Package org.drools.core.reteoo
Class AlphaNode
java.lang.Object
org.drools.core.common.BaseNode
org.drools.core.reteoo.ObjectSource
org.drools.core.reteoo.AlphaNode
- All Implemented Interfaces:
Serializable,NetworkNode,ObjectSink,ObjectSinkNode,Sink
AlphaNodes are nodes in the Rete network used
to apply FieldConstraint<.code>s on asserted fact
objects where the FieldConstraints have no dependencies on any other of the facts in the current Rule.- See Also:
-
Field Summary
FieldsFields inherited from class org.drools.core.reteoo.ObjectSource
alphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, sourceFields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId -
Constructor Summary
ConstructorsConstructorDescriptionAlphaNode(int id, AlphaNodeFieldConstraint constraint, ObjectSource objectSource, BuildContext context) Construct anAlphaNodewith a unique id using the providedFieldConstraintand the givenObjectSource. -
Method Summary
Modifier and TypeMethodDescriptionvoidassertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) voidbyPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) org.drools.util.bitmask.BitMaskcalculateDeclaredMask(Pattern pattern, ObjectType objectType, List<String> settableProperties) voiddoAttach(BuildContext context) booleanRetruns theFieldConstraintorg.drools.util.bitmask.BitMaskorg.drools.util.bitmask.BitMaskReturns the next nodeReturns the previous nodeintgetType()voidmodifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) voidSets the next nodevoidsetPartitionId(BuildContext context, RuleBasePartitionId partitionId) Sets the partition this node belongs tovoidsetPreviousObjectSinkNode(ObjectSinkNode previous) Sets the previous nodetoString()voidupdateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory) Methods inherited from class org.drools.core.reteoo.ObjectSource
addObjectSink, doRemove, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, getRuleBase, initDeclaredMask, isInUse, networkUpdated, removeObjectSink, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionIdWithSinks, setSourcePartitionId, updateMaskMethods inherited from class org.drools.core.common.BaseNode
addAssociatedTerminal, addAssociation, addAssociation, attach, getAssociatedRules, getAssociatedTerminalsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hasAssociatedTerminal, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociatedTerminal, removeAssociation, setId, setStreamModeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.drools.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, isRightInputIsRiaNode, removeAssociatedTerminalMethods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
Field Details
-
constraint
TheFieldConstraint
-
-
Constructor Details
-
AlphaNode
public AlphaNode() -
AlphaNode
public AlphaNode(int id, AlphaNodeFieldConstraint constraint, ObjectSource objectSource, BuildContext context) Construct anAlphaNodewith a unique id using the providedFieldConstraintand the givenObjectSource. Set the boolean flag to true if the node is supposed to have local memory, or false otherwise. Memory is optional forAlphaNodes and is only of benefic when adding additionalRules at runtime.- Parameters:
id- Node's IDconstraint- Node's constraintsobjectSource- Node's object source
-
-
Method Details
-
getConstraint
Retruns theFieldConstraint- Returns:
FieldConstraint
-
getType
public int getType()- Specified by:
getTypein interfaceNetworkNode
-
doAttach
-
setPartitionId
Description copied from class:BaseNodeSets the partition this node belongs to- Overrides:
setPartitionIdin classObjectSource
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
assertObjectin interfaceObjectSink
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
modifyObjectin interfaceObjectSink
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator) - Specified by:
byPassModifyToBetaNodein interfaceObjectSink
-
updateSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory) - Specified by:
updateSinkin classObjectSource
-
toString
-
equals
-
getNextObjectSinkNode
Returns the next node- Specified by:
getNextObjectSinkNodein interfaceObjectSinkNode- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
Sets the next node- Specified by:
setNextObjectSinkNodein interfaceObjectSinkNode- Parameters:
next- The next ObjectSinkNode
-
getPreviousObjectSinkNode
Returns the previous node- Specified by:
getPreviousObjectSinkNodein interfaceObjectSinkNode- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
Sets the previous node- Specified by:
setPreviousObjectSinkNodein interfaceObjectSinkNode- Parameters:
previous- The previous ObjectSinkNode
-
calculateDeclaredMask
public org.drools.util.bitmask.BitMask calculateDeclaredMask(Pattern pattern, ObjectType objectType, List<String> settableProperties) - Specified by:
calculateDeclaredMaskin classObjectSource
-
getDeclaredMask
public org.drools.util.bitmask.BitMask getDeclaredMask()- Overrides:
getDeclaredMaskin classObjectSource
-
getInferredMask
public org.drools.util.bitmask.BitMask getInferredMask()
-