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:
java.io.Serializable
,org.drools.base.common.NetworkNode
,ObjectSink
,ObjectSinkNode
,Sink
public class AlphaNode extends ObjectSource implements ObjectSinkNode
AlphaNodes
are nodes in theRete
network used to applyFieldConstraint<.code>s on asserted fact objects where the
FieldConstraint
s have no dependencies on any other of the facts in the currentRule
.- See Also:
AlphaNodeFieldConstraint
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.drools.base.rule.constraint.AlphaNodeFieldConstraint
constraint
TheFieldConstraint
-
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, org.drools.base.rule.constraint.AlphaNodeFieldConstraint constraint, ObjectSource objectSource, BuildContext context)
Construct anAlphaNode
with a unique id using the providedFieldConstraint
and the givenObjectSource
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
void
byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
org.drools.core.util.bitmask.BitMask
calculateDeclaredMask(org.drools.base.base.ObjectType objectType, java.util.List<java.lang.String> settableProperties)
void
doAttach(BuildContext context)
boolean
equals(java.lang.Object object)
org.drools.base.rule.constraint.AlphaNodeFieldConstraint
getConstraint()
Retruns theFieldConstraint
org.drools.core.util.bitmask.BitMask
getDeclaredMask()
org.drools.core.util.bitmask.BitMask
getInferredMask()
ObjectSinkNode
getNextObjectSinkNode()
Returns the next nodeObjectSinkNode
getPreviousObjectSinkNode()
Returns the previous nodeshort
getType()
void
modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
void
setNextObjectSinkNode(ObjectSinkNode next)
Sets the next nodevoid
setPartitionId(BuildContext context, org.drools.base.common.RuleBasePartitionId partitionId)
Sets the partition this node belongs tovoid
setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous nodejava.lang.String
toString()
void
updateSink(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, 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.base.common.NetworkNode
addAssociatedTerminal, getAssociatedRules, getAssociatedTerminalsSize, getId, getPartitionId, getSinks, hasAssociatedTerminal, isAssociatedWith, isRightInputIsRiaNode, removeAssociatedTerminal
-
Methods inherited from interface org.drools.core.reteoo.ObjectSinkNode
setPartitionIdWithSinks
-
-
-
-
Constructor Detail
-
AlphaNode
public AlphaNode()
-
AlphaNode
public AlphaNode(int id, org.drools.base.rule.constraint.AlphaNodeFieldConstraint constraint, ObjectSource objectSource, BuildContext context)
Construct anAlphaNode
with a unique id using the providedFieldConstraint
and the givenObjectSource
. Set the boolean flag to true if the node is supposed to have local memory, or false otherwise. Memory is optional forAlphaNode
s and is only of benefic when adding additionalRule
s at runtime.- Parameters:
id
- Node's IDconstraint
- Node's constraintsobjectSource
- Node's object source
-
-
Method Detail
-
getConstraint
public org.drools.base.rule.constraint.AlphaNodeFieldConstraint getConstraint()
Retruns theFieldConstraint
- Returns:
FieldConstraint
-
getType
public short getType()
- Specified by:
getType
in interfaceorg.drools.base.common.NetworkNode
-
doAttach
public void doAttach(BuildContext context)
-
setPartitionId
public void setPartitionId(BuildContext context, org.drools.base.common.RuleBasePartitionId partitionId)
Description copied from class:BaseNode
Sets the partition this node belongs to- Overrides:
setPartitionId
in classObjectSource
-
assertObject
public void assertObject(InternalFactHandle factHandle, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
assertObject
in interfaceObjectSink
-
modifyObject
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
modifyObject
in interfaceObjectSink
-
byPassModifyToBetaNode
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, ReteEvaluator reteEvaluator)
- Specified by:
byPassModifyToBetaNode
in interfaceObjectSink
-
updateSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
- Specified by:
updateSink
in classObjectSource
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
Returns the next node- Specified by:
getNextObjectSinkNode
in interfaceObjectSinkNode
- Returns:
- The next ObjectSinkNode
-
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node- Specified by:
setNextObjectSinkNode
in interfaceObjectSinkNode
- Parameters:
next
- The next ObjectSinkNode
-
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
Returns the previous node- Specified by:
getPreviousObjectSinkNode
in interfaceObjectSinkNode
- Returns:
- The previous ObjectSinkNode
-
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node- Specified by:
setPreviousObjectSinkNode
in interfaceObjectSinkNode
- Parameters:
previous
- The previous ObjectSinkNode
-
calculateDeclaredMask
public org.drools.core.util.bitmask.BitMask calculateDeclaredMask(org.drools.base.base.ObjectType objectType, java.util.List<java.lang.String> settableProperties)
- Specified by:
calculateDeclaredMask
in classObjectSource
-
getDeclaredMask
public org.drools.core.util.bitmask.BitMask getDeclaredMask()
- Overrides:
getDeclaredMask
in classObjectSource
-
getInferredMask
public org.drools.core.util.bitmask.BitMask getInferredMask()
-
-