org.drools.reteoo
Class AlphaNode
java.lang.Object
org.drools.common.BaseNode
org.drools.reteoo.ObjectSource
org.drools.reteoo.AlphaNode
- All Implemented Interfaces:
- Externalizable, Serializable, NetworkNode, NodeMemory, ObjectSink, ObjectSinkNode, Sink
public class AlphaNode
- extends ObjectSource
- implements ObjectSinkNode, NodeMemory
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
.
- See Also:
AlphaNodeFieldConstraint
,
Serialized Form
AlphaNode
public AlphaNode()
AlphaNode
public AlphaNode(int id,
AlphaNodeFieldConstraint constraint,
ObjectSource objectSource,
BuildContext context)
- Construct an
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.
- Parameters:
id
- Node's IDconstraint
- Node's constraintsobjectSource
- Node's object source
readExternal
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
- Specified by:
readExternal
in interface Externalizable
- Overrides:
readExternal
in class ObjectSource
- Throws:
IOException
ClassNotFoundException
writeExternal
public void writeExternal(ObjectOutput out)
throws IOException
- Specified by:
writeExternal
in interface Externalizable
- Overrides:
writeExternal
in class ObjectSource
- Throws:
IOException
getConstraint
public AlphaNodeFieldConstraint getConstraint()
- Retruns the
FieldConstraint
- Returns:
FieldConstraint
attach
public void attach()
- Description copied from class:
BaseNode
- Attaches the node into the network. Usually to the parent
ObjectSource
or TupleSource
- Specified by:
attach
in class BaseNode
attach
public void attach(InternalWorkingMemory[] workingMemories)
- Specified by:
attach
in class BaseNode
assertObject
public void assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
assertObject
in interface ObjectSink
modifyObject
public void modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
modifyObject
in interface ObjectSink
updateSink
public void updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
updateSink
in class ObjectSource
createMemory
public Memory createMemory(RuleBaseConfiguration config)
- Creates a HashSet for the AlphaNode's memory.
- Specified by:
createMemory
in interface NodeMemory
toString
public String toString()
- Overrides:
toString
in class BaseNode
hashCode
public int hashCode()
- Description copied from class:
BaseNode
- The hashCode return is simply the unique id of the node. It is expected that base classes will also implement equals(Object object).
- Overrides:
hashCode
in class BaseNode
equals
public boolean equals(Object object)
- Overrides:
equals
in class Object
getNextObjectSinkNode
public ObjectSinkNode getNextObjectSinkNode()
- Returns the next node
- Specified by:
getNextObjectSinkNode
in interface ObjectSinkNode
- Returns:
- The next ObjectSinkNode
setNextObjectSinkNode
public void setNextObjectSinkNode(ObjectSinkNode next)
- Sets the next node
- Specified by:
setNextObjectSinkNode
in interface ObjectSinkNode
- Parameters:
next
- The next ObjectSinkNode
getPreviousObjectSinkNode
public ObjectSinkNode getPreviousObjectSinkNode()
- Returns the previous node
- Specified by:
getPreviousObjectSinkNode
in interface ObjectSinkNode
- Returns:
- The previous ObjectSinkNode
setPreviousObjectSinkNode
public void setPreviousObjectSinkNode(ObjectSinkNode previous)
- Sets the previous node
- Specified by:
setPreviousObjectSinkNode
in interface ObjectSinkNode
- Parameters:
previous
- The previous ObjectSinkNode
Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.