Class BuildContext
- java.lang.Object
- 
- jadex.rules.rulesystem.rete.builder.BuildContext
 
- 
 public class BuildContext extends java.lang.ObjectThe build context contains all relevant data about the current net building process.
- 
- 
Field SummaryFields Modifier and Type Field Description protected booleanalphaFlag indicating if the builder is currently creating alpha nodes.protected INodelastanodeThe last alpha node.protected INodelastbnodeThe last beta node.protected booleanrightunavailableFlag indicating that no right input is available (for collect nodes).protected ReteNoderootThe root node.protected IRuleruleThe currently built rule.protected inttuplecntThe tuple cnt.protected java.util.MapvarinfosThe first variable occurrence.
 - 
Constructor SummaryConstructors Constructor Description BuildContext(ReteNode root, IRule rule)Create a new build context.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddVarInfo(VarInfo vi)Add a new var info.INodegetLastAlphaNode()Get the lastnode.INodegetLastBetaNode()Get the lastnode.ReteNodegetRootNode()Get the root.IRulegetRule()Get the rule.intgetTupleCount()Get the tuple count.VarInfogetVarInfo(Variable var)Get the variable info.java.util.MapgetVarInfos()Get the variable infos.booleanisAlpha()For each object condition, the builder first creates alpha nodes for all constraints that only apply to the object itself.booleanisConstrainable(Variable var)Test if a variable is constrainable (alpha node), i.e.booleanisJoinable(Variable var)Test if a found variable is joinable (beta node), i.e.booleanisLeftAvailable(Variable var)Test if a variable is left available.booleanisRightUnavailable()Get the rightunavailable.voidsetAlpha(boolean alpha)Set the alpha flag.voidsetLastAlphaNode(INode lastanode)Set the lastnode.voidsetLastBetaNode(INode lastbnode)Set the lastnode.voidsetRightUnavailable(boolean rightunavailable)Set the rightunavailable.voidsetRootNode(ReteNode root)Set the root.voidsetRule(IRule rule)Set the rule.voidsetTupleCount(int tuplecnt)Set the tuple count.
 
- 
- 
- 
Field Detail- 
rootprotected ReteNode root The root node.
 - 
ruleprotected IRule rule The currently built rule.
 - 
lastanodeprotected INode lastanode The last alpha node.
 - 
lastbnodeprotected INode lastbnode The last beta node.
 - 
tuplecntprotected int tuplecnt The tuple cnt.
 - 
varinfosprotected java.util.Map varinfos The first variable occurrence.
 - 
rightunavailableprotected boolean rightunavailable Flag indicating that no right input is available (for collect nodes).
 - 
alphaprotected boolean alpha Flag indicating if the builder is currently creating alpha nodes.
 
- 
 - 
Method Detail- 
getRootNodepublic ReteNode getRootNode() Get the root.- Returns:
- The root.
 
 - 
setRootNodepublic void setRootNode(ReteNode root) Set the root.- Parameters:
- root- The root to set.
 
 - 
getRulepublic IRule getRule() Get the rule.- Returns:
- The rule.
 
 - 
setRulepublic void setRule(IRule rule) Set the rule.- Parameters:
- rule- The rule to set.
 
 - 
getLastAlphaNodepublic INode getLastAlphaNode() Get the lastnode.- Returns:
- The lastnode.
 
 - 
setLastAlphaNodepublic void setLastAlphaNode(INode lastanode) Set the lastnode.- Parameters:
- lastnode- The lastnode to set.
 
 - 
getLastBetaNodepublic INode getLastBetaNode() Get the lastnode.- Returns:
- The lastnode.
 
 - 
setLastBetaNodepublic void setLastBetaNode(INode lastbnode) Set the lastnode.- Parameters:
- lastnode- The lastnode to set.
 
 - 
getTupleCountpublic int getTupleCount() Get the tuple count.- Returns:
- The tuplecnt.
 
 - 
setTupleCountpublic void setTupleCount(int tuplecnt) Set the tuple count.- Parameters:
- tuplecnt- The tuplecnt to set.
 
 - 
addVarInfopublic void addVarInfo(VarInfo vi) Add a new var info.
 - 
getVarInfopublic VarInfo getVarInfo(Variable var) Get the variable info.- Parameters:
- var- The variable.
- Returns:
- The variable info.
 
 - 
getVarInfospublic java.util.Map getVarInfos() Get the variable infos.- Returns:
- The variable infos.
 
 - 
isJoinablepublic boolean isJoinable(Variable var) Test if a found variable is joinable (beta node), i.e. if it was formerly used in another condition.- Parameters:
- var- The variable.
- Returns:
- True, if joinable.
 
 - 
isConstrainablepublic boolean isConstrainable(Variable var) Test if a variable is constrainable (alpha node), i.e. was formerly used in this condition.- Parameters:
- var- The variable.
- Returns:
- True, if constrainable.
 
 - 
isLeftAvailablepublic boolean isLeftAvailable(Variable var) Test if a variable is left available.- Parameters:
- var- The variable.
- Returns:
- True, if left available.
 
 - 
isRightUnavailablepublic boolean isRightUnavailable() Get the rightunavailable.- Returns:
- The rightunavailable.
 
 - 
setRightUnavailablepublic void setRightUnavailable(boolean rightunavailable) Set the rightunavailable.- Parameters:
- rightunavailable- The rightunavailable to set.
 
 - 
isAlphapublic boolean isAlpha() For each object condition, the builder first creates alpha nodes for all constraints that only apply to the object itself. Afterwards, a beta node is created, containing the additional (join) constraints.- Returns:
- The alpha flag.
 
 - 
setAlphapublic void setAlpha(boolean alpha) Set the alpha flag.- See Also:
- isAlpha()
 
 
- 
 
-