private void updateLeafSet(BaseNode baseNode, NodeSet leafSet) { if ( baseNode instanceof AlphaNode ) { ((AlphaNode) baseNode).resetInferredMask(); for ( ObjectSink sink : ((AlphaNode) baseNode).getSinkPropagator().getSinks() ) { if ( ((BaseNode)sink).isInUse() ) { updateLeafSet( ( BaseNode ) sink, leafSet ); } } } else if ( baseNode instanceof LeftInputAdapterNode ) { for ( LeftTupleSink sink : ((LeftInputAdapterNode) baseNode).getSinkPropagator().getSinks() ) { if ( sink instanceof RuleTerminalNode ) { leafSet.add( (BaseNode) sink ); } else if ( ((BaseNode)sink).isInUse() ) { updateLeafSet( ( BaseNode ) sink, leafSet ); } } } else if ( baseNode instanceof EvalConditionNode ) { for ( LeftTupleSink sink : ((EvalConditionNode) baseNode).getSinkPropagator().getSinks() ) { if ( ((BaseNode)sink).isInUse() ) { updateLeafSet( ( BaseNode ) sink, leafSet ); } } } else if ( baseNode instanceof BetaNode ) { if ( ((BaseNode)baseNode).isInUse() ) { leafSet.add( baseNode ); } } }
public void remove(RuleRemovalContext context, ReteooBuilder builder, InternalWorkingMemory[] workingMemories) { context.addRemovedNode(this); this.removeAssociation( context.getRule() ); doRemove( context, builder, workingMemories ); if ( !this.isInUse() && !(this instanceof EntryPointNode) ) { builder.getIdGenerator().releaseId( this.getId() ); } }
if ( node.isInUse() ) { if ( node instanceof AlphaNode ) { updateLeafSet(node, leafSet );