/** * Count the number of children. * @param node The node. * @return The number of children. */ protected int getChildCount(INode node) { int ret = 0; if(node instanceof ITupleSourceNode) { ITupleSourceNode tsn = (ITupleSourceNode)node; ITupleConsumerNode[] cs = tsn.getTupleConsumers(); ret += cs==null? 0: cs.length; } if(node instanceof IObjectSourceNode) { IObjectSourceNode tsn = (IObjectSourceNode)node; IObjectConsumerNode[] cs = tsn.getObjectConsumers(); ret += cs==null? 0: cs.length; } return ret; }
/** * Do clone makes a deep clone without regarding cycles. * Method is overridden by subclasses to actually incorporate their attributes. * @param theclone The clone. */ protected void doClone(Object theclone) { TerminalNode ret = (TerminalNode)theclone; // Source node is set from creating node ret.tsource = (ITupleSourceNode)tsource.clone(); // Extractors shallow copy ret.extractors = (Map)((HashMap)extractors).clone(); // Rule keeps the same }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { // Delegate to source node. return tsource.getNodeMemory(mem); }
&& ((ITupleSourceNode)context.getLastBetaNode()).getTupleConsumers()==null &&!(context.getLastBetaNode() instanceof NotNode) && (((BetaNode)context.getLastBetaNode()).getTupleSource()==leftnode beta.getTupleSource().removeTupleConsumer(beta); IObjectSourceNode osource = beta.getObjectSource(); osource.removeObjectConsumer(beta);
if(nodesharing) ITupleConsumerNode[] tcon = tsource.getTupleConsumers(); for(int i=0; ria==null && tcon!=null && i<tcon.length; i++) tsource.addTupleConsumer(ria);
source.removeTupleConsumer(consumer); removeNodeUsage(source);
ITupleConsumerNode c = (ITupleConsumerNode)consumer; s.addTupleConsumer(c); c.setTupleSource(s);
&& ((ITupleSourceNode)context.getLastBetaNode()).getTupleConsumers()==null &&!(context.getLastBetaNode() instanceof NotNode) && (((BetaNode)context.getLastBetaNode()).getTupleSource()==leftnode beta.getTupleSource().removeTupleConsumer(beta); IObjectSourceNode osource = beta.getObjectSource(); osource.removeObjectConsumer(beta);
if(nodesharing) ITupleConsumerNode[] tcon = tsource.getTupleConsumers(); for(int i=0; ria==null && tcon!=null && i<tcon.length; i++) tsource.addTupleConsumer(ria);
source.removeTupleConsumer(consumer); removeNodeUsage(source);
ITupleConsumerNode c = (ITupleConsumerNode)consumer; s.addTupleConsumer(c); c.setTupleSource(s);
/** * Count the number of children. * @param node The node. * @return The number of children. */ protected int getChildCount(INode node) { int ret = 0; if(node instanceof ITupleSourceNode) { ITupleSourceNode tsn = (ITupleSourceNode)node; ITupleConsumerNode[] cs = tsn.getTupleConsumers(); ret += cs==null? 0: cs.length; } if(node instanceof IObjectSourceNode) { IObjectSourceNode tsn = (IObjectSourceNode)node; IObjectConsumerNode[] cs = tsn.getObjectConsumers(); ret += cs==null? 0: cs.length; } return ret; }
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { // Delegate to source node. return tsource.getNodeMemory(mem); }
/** * Do clone makes a deep clone without regarding cycles. * Method is overridden by subclasses to actually incorporate their attributes. * @param theclone The clone. */ protected void doClone(Object theclone) { TerminalNode ret = (TerminalNode)theclone; // Source node is set from creating node ret.tsource = (ITupleSourceNode)tsource.clone(); // Extractors shallow copy ret.extractors = (Map)((HashMap)extractors).clone(); // Rule keeps the same }
ITupleConsumerNode[] consumers = ((ITupleSourceNode)node).getTupleConsumers(); for(int j=0; j<consumers.length; j++)
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { // Hack??? // try { return getTupleSource().getNodeMemory(mem); } // catch(Exception e) // { // Object o = getTupleSource().getNodeMemory(mem); // return null; // } }
/** * Do clone makes a deep clone without regarding cycles. * Method is overridden by subclasses to actually incorporate their attributes. * @param theclone The clone. */ protected void doClone(Object theclone) { RightInputAdapterNode clone = (RightInputAdapterNode)theclone; // Deep clone tuple consumers clone.oconsumers = new IObjectConsumerNode[oconsumers.length]; for(int i=0; i<oconsumers.length; i++) clone.oconsumers[i] = (IObjectConsumerNode)oconsumers[i].clone(); // Set the source clone.tsource = (ITupleSourceNode)tsource.clone(); // Shallow copy the relevant attributes if(relevants!=null) clone.relevants = (AttributeSet)((AttributeSet)relevants).clone(); } }
ITupleConsumerNode[] consumers = ((ITupleSourceNode)node).getTupleConsumers(); for(int j=0; j<consumers.length; j++)
/** * Get the memory for this node. * @return The memory. */ public Collection getNodeMemory(ReteMemory mem) { // Hack??? // try { return getTupleSource().getNodeMemory(mem); } // catch(Exception e) // { // Object o = getTupleSource().getNodeMemory(mem); // return null; // } }
/** * Do clone makes a deep clone without regarding cycles. * Method is overridden by subclasses to actually incorporate their attributes. * @param theclone The clone. */ protected void doClone(Object theclone) { CollectNode clone = (CollectNode)theclone; // Deep clone tuple consumers clone.tconsumers = new ITupleConsumerNode[tconsumers.length]; for(int i=0; i<tconsumers.length; i++) clone.tconsumers[i] = (ITupleConsumerNode)tconsumers[i].clone(); // Set the tuple source clone.tsource = (ITupleSourceNode)tsource.clone(); // Shallow clone evaluators consumers if(evaluators!=null) { clone.evaluators = new IConstraintEvaluator[evaluators.length]; System.arraycopy(evaluators, 0, clone.evaluators, 0, evaluators.length); } // Shallow copy the relevant attributes if(relevants!=null) clone.relevants = (AttributeSet)((AttributeSet)relevants).clone(); }