当前页面:
在线文档首页 >
JBoss RULES 4.0.0.11754MR2 API 英文版文档
AlphaNode (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档
org.drools.reteoo
Class AlphaNode
java.lang.Object
org.drools.common.BaseNode
org.drools.reteoo.ObjectSource
org.drools.reteoo.AlphaNode
- All Implemented Interfaces:
- Serializable, NetworkNode, NodeMemory, ObjectSink, ObjectSinkNode
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
.
- Author:
- Mark Proctor, Bob McWhirter
- See Also:
AlphaNodeFieldConstraint
,
Serialized Form
AlphaNode
public AlphaNode(int id,
AlphaNodeFieldConstraint constraint,
ObjectSource objectSource)
- Construct an
AlphaNode
with a unique id using the provided
FieldConstraint
and the given ObjectSource
.
Nodes created in this way will have a local memory by default.
- Parameters:
id
- constraint
- objectSource
-
AlphaNode
public AlphaNode(int id,
AlphaNodeFieldConstraint constraint,
ObjectSource objectSource,
boolean hasMemory,
int alphaNodeHashingThreshold)
- 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 sourcehasMemory
- true if node shall be configured with local memory. False otherwise.
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 handle,
PropagationContext context,
InternalWorkingMemory workingMemory)
throws FactException
- Description copied from interface:
ObjectSink
- Assert a new
FactHandleImpl
.
- Specified by:
assertObject
in interface ObjectSink
- Parameters:
handle
- The asserted FactHandle/code>.context
- The PropagationContext
of the WorkingMemory action.workingMemory
- the WorkingMemory
session.
- Throws:
FactException
retractObject
public void retractObject(InternalFactHandle handle,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Description copied from interface:
ObjectSink
- Retract an existing
FactHandleImpl
.
- Specified by:
retractObject
in interface ObjectSink
- Parameters:
handle
- The FactHandle/code> to retract.context
- The PropagationContext
of the WorkingMemory action.workingMemory
- the WorkingMemory
session.
updateSink
public void updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory)
- Specified by:
updateSink
in class ObjectSource
remove
public void remove(BaseNode node,
InternalWorkingMemory[] workingMemories)
- Description copied from class:
BaseNode
- Removes the node from teh network. Usually from the parent
ObjectSource
or TupleSource
- Specified by:
remove
in class BaseNode
createMemory
public Object 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-2007 JBoss Inc.. All Rights Reserved.