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 FieldConstraint
s have no dependencies on any other of the facts in the current Rule
.
AlphaNodeFieldConstraint
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
AlphaNode.AlphaMemory |
declaredMask, inferredMask, sink, source
associations, 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, updateMask
addAssociation, getAssociations, getId, getPartitionId, isStreamMode, remove, removeAssociation, setId, setPartitionId, setStreamMode
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getAssociations, getId, getPartitionId
getId
public 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 AlphaNode
s
and is only of benefic when adding additional Rule
s at runtime.id
- Node's IDconstraint
- Node's constraintsobjectSource
- Node's object sourcepublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class ObjectSource
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class ObjectSource
IOException
public AlphaNodeFieldConstraint getConstraint()
FieldConstraint
FieldConstraint
public short getType()
getType
in interface NetworkNode
public void attach(BuildContext context)
BaseNode
ObjectSource
or TupleSource
public void assertObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
assertObject
in interface ObjectSink
public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
modifyObject
in interface ObjectSink
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
byPassModifyToBetaNode
in interface ObjectSink
public void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
updateSink
in class ObjectSource
public AlphaNode.AlphaMemory createMemory(RuleBaseConfiguration config, InternalWorkingMemory wm)
createMemory
in interface MemoryFactory<AlphaNode.AlphaMemory>
public int hashCode()
BaseNode
public int calculateHashCode()
public ObjectSinkNode getNextObjectSinkNode()
getNextObjectSinkNode
in interface ObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
setNextObjectSinkNode
in interface ObjectSinkNode
next
- The next ObjectSinkNodepublic ObjectSinkNode getPreviousObjectSinkNode()
getPreviousObjectSinkNode
in interface ObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
setPreviousObjectSinkNode
in interface ObjectSinkNode
previous
- The previous ObjectSinkNodepublic BitMask calculateDeclaredMask(List<String> settableProperties)
calculateDeclaredMask
in class ObjectSource
public BitMask getDeclaredMask()
getDeclaredMask
in class ObjectSource
public BitMask getInferredMask()
public void addObjectSink(ObjectSink objectSink)
ObjectSource
ObjectSink
so that it may receive
FactHandleImpl
propagated from this
ObjectSource
.addObjectSink
in class ObjectSource
objectSink
- The ObjectSink
to receive propagated
FactHandleImpl
.Copyright © 2001–2015 JBoss by Red Hat. All rights reserved.