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:
NetworkNode,ObjectSink,ObjectSinkNode,Sink
public class AlphaNode extends ObjectSource implements ObjectSinkNode
AlphaNodesare nodes in theRetenetwork used to applyFieldConstraint<.code>s on asserted fact objects where theFieldConstraints have no dependencies on any other of the facts in the currentRule.- See Also:
AlphaNodeFieldConstraint
-
-
Field Summary
Fields Modifier and Type Field Description protected AlphaNodeFieldConstraintconstraintTheFieldConstraint-
Fields inherited from class org.drools.core.reteoo.ObjectSource
alphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, source
-
Fields inherited from class org.drools.core.common.BaseNode
associations, hashcode, id, memoryId, partitionId, partitionsEnabled
-
-
Constructor Summary
Constructors Constructor Description AlphaNode()AlphaNode(int id, AlphaNodeFieldConstraint constraint, ObjectSource objectSource, BuildContext context)Construct anAlphaNodewith a unique id using the providedFieldConstraintand the givenObjectSource.
-
Method Summary
-
Methods inherited from class org.drools.core.reteoo.ObjectSource
addObjectSink, doRemove, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, getRuleBase, initDeclaredMask, isInUse, networkUpdated, removeObjectSink, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionIdWithSinks, setSourcePartitionId, updateMask
-
Methods 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, setPartitionsEnabled, setStreamMode
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.drools.core.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, removeAssociatedTerminal
-
Methods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
-
-
-
Field Detail
-
constraint
protected AlphaNodeFieldConstraint constraint
TheFieldConstraint
-
-
Constructor Detail
-
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 Detail
-
getConstraint
public AlphaNodeFieldConstraint getConstraint()
Retruns theFieldConstraint- Returns:
FieldConstraint
-
getType
public short getType()
- Specified by:
getTypein interfaceNetworkNode
-
doAttach
public void doAttach(BuildContext context)
-
setPartitionId
public void setPartitionId(BuildContext context, RuleBasePartitionId partitionId)
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
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equalsin classjava.lang.Object
-
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
Returns the next node- Specified by:
getNextObjectSinkNodein interfaceObjectSinkNode- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node- Specified by:
setNextObjectSinkNodein interfaceObjectSinkNode- Parameters:
next- The next ObjectSinkNode
-
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
Returns the previous node- Specified by:
getPreviousObjectSinkNodein interfaceObjectSinkNode- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node- Specified by:
setPreviousObjectSinkNodein interfaceObjectSinkNode- Parameters:
previous- The previous ObjectSinkNode
-
calculateDeclaredMask
public BitMask calculateDeclaredMask(ObjectType objectType, java.util.List<java.lang.String> settableProperties)
- Specified by:
calculateDeclaredMaskin classObjectSource
-
getDeclaredMask
public BitMask getDeclaredMask()
- Overrides:
getDeclaredMaskin classObjectSource
-
getInferredMask
public BitMask getInferredMask()
-
-