public class AlphaNode extends ObjectSource implements ObjectSinkNode, MemoryFactory<AlphaNode.AlphaMemory>
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.AlphaNodeFieldConstraint,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
AlphaNode.AlphaMemory |
declaredMask, inferredMask, sink, sourceassociations, id, partitionId, partitionsEnabled| Constructor and Description |
|---|
AlphaNode() |
AlphaNode(int id,
AlphaNodeFieldConstraint constraint,
ObjectSource objectSource,
BuildContext context)
Construct an
AlphaNode with a unique id using the provided
FieldConstraint and the given ObjectSource. |
| Modifier and Type | Method and Description |
|---|---|
void |
addObjectSink(ObjectSink objectSink)
Adds the
ObjectSink so that it may receive
FactHandleImpl propagated from this
ObjectSource. |
void |
assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory) |
void |
attach(BuildContext context)
Attaches the node into the network.
|
void |
byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory) |
BitMask |
calculateDeclaredMask(List<String> settableProperties) |
int |
calculateHashCode() |
AlphaNode.AlphaMemory |
createMemory(RuleBaseConfiguration config,
InternalWorkingMemory wm)
Creates a HashSet for the AlphaNode's memory.
|
boolean |
equals(Object object) |
AlphaNodeFieldConstraint |
getConstraint()
Retruns the
FieldConstraint |
BitMask |
getDeclaredMask() |
BitMask |
getInferredMask() |
ObjectSinkNode |
getNextObjectSinkNode()
Returns the next node
|
ObjectSinkNode |
getPreviousObjectSinkNode()
Returns the previous node
|
short |
getType() |
int |
hashCode()
The hashCode return is simply the unique id of the node.
|
void |
modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory) |
void |
readExternal(ObjectInput in) |
void |
setNextObjectSinkNode(ObjectSinkNode next)
Sets the next node
|
void |
setPreviousObjectSinkNode(ObjectSinkNode previous)
Sets the previous node
|
String |
toString() |
void |
updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory) |
void |
writeExternal(ObjectOutput out) |
doRemove, getKnowledgeBase, getObjectTypeNode, getParentObjectSource, getSinkPropagator, initDeclaredMask, isInUse, networkUpdated, removeObjectSink, resetInferredMask, updateMaskaddAssociation, attach, getAssociations, getId, getPartitionId, isStreamMode, remove, removeAssociation, setId, setPartitionId, setStreamModeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAssociations, getId, getPartitionIdgetIdpublic AlphaNode()
public AlphaNode(int id,
AlphaNodeFieldConstraint constraint,
ObjectSource objectSource,
BuildContext context)
AlphaNode with a unique id using the provided
FieldConstraint and the given ObjectSource.
Set the boolean flag to true if the node is supposed to have local
memory, or false otherwise. Memory is optional for AlphaNodes
and is only of benefic when adding additional Rules at runtime.id - Node's IDconstraint - Node's constraintsobjectSource - Node's object sourcepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class ObjectSourceIOExceptionClassNotFoundExceptionpublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class ObjectSourceIOExceptionpublic AlphaNodeFieldConstraint getConstraint()
FieldConstraintFieldConstraintpublic short getType()
getType in interface NetworkNodepublic void attach(BuildContext context)
BaseNodeObjectSource or TupleSourcepublic void assertObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
assertObject in interface ObjectSinkpublic void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
modifyObject in interface ObjectSinkpublic void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
byPassModifyToBetaNode in interface ObjectSinkpublic void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
updateSink in class ObjectSourcepublic AlphaNode.AlphaMemory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
createMemory in interface MemoryFactory<AlphaNode.AlphaMemory>public int hashCode()
BaseNodepublic int calculateHashCode()
public ObjectSinkNode getNextObjectSinkNode()
getNextObjectSinkNode in interface ObjectSinkNodepublic void setNextObjectSinkNode(ObjectSinkNode next)
setNextObjectSinkNode in interface ObjectSinkNodenext - The next ObjectSinkNodepublic ObjectSinkNode getPreviousObjectSinkNode()
getPreviousObjectSinkNode in interface ObjectSinkNodepublic void setPreviousObjectSinkNode(ObjectSinkNode previous)
setPreviousObjectSinkNode in interface ObjectSinkNodeprevious - The previous ObjectSinkNodepublic BitMask calculateDeclaredMask(List<String> settableProperties)
calculateDeclaredMask in class ObjectSourcepublic BitMask getDeclaredMask()
getDeclaredMask in class ObjectSourcepublic BitMask getInferredMask()
public void addObjectSink(ObjectSink objectSink)
ObjectSourceObjectSink so that it may receive
FactHandleImpl propagated from this
ObjectSource.addObjectSink in class ObjectSourceobjectSink - The ObjectSink to receive propagated
FactHandleImpl.Copyright © 2001–2015 JBoss by Red Hat. All rights reserved.