/** * Check the consistency of the node. */ public boolean checkNodeConsistency(ReteMemory mem) { // Mark node as checked (for debugging). Object node = this; while(!(node instanceof ReteNode)) { if(node instanceof IObjectConsumerNode) { node = ((IObjectConsumerNode)node).getObjectSource(); } else if(node instanceof ITupleConsumerNode) { node = ((ITupleConsumerNode)node).getTupleSource(); } else { throw new RuntimeException("Unhandled node type: "+node); } } ((ReteNode)node).checked.add(this); // Empty default implementation. return true; } }
/** * Check the consistency of the node. */ public boolean checkNodeConsistency(ReteMemory mem) { // Mark node as checked (for debugging). Object node = this; while(!(node instanceof ReteNode)) { if(node instanceof IObjectConsumerNode) { node = ((IObjectConsumerNode)node).getObjectSource(); } else if(node instanceof ITupleConsumerNode) { node = ((ITupleConsumerNode)node).getTupleSource(); } else { throw new RuntimeException("Unhandled node type: "+node); } } ((ReteNode)node).checked.add(this); // Empty default implementation. return true; } }
/** * Check the consistency of the node. */ public boolean checkNodeConsistency(ReteMemory mem) { boolean consistent = true; Collection tuples = getNodeMemory(mem); Collection objects = getObjectSource().getNodeMemory(mem); if(tuples!=null) { for(Iterator it=tuples.iterator(); consistent && it.hasNext(); ) { Tuple tuple = (Tuple)it.next(); consistent = objects.contains(tuple.getObject()); } } Object node = this; while(node instanceof IObjectConsumerNode) node = ((IObjectConsumerNode)node).getObjectSource(); ((ReteNode)node).checked.add(this); return consistent; } }
/** * Check the consistency of the node. */ public boolean checkNodeConsistency(ReteMemory mem) { boolean consistent = true; Collection tuples = getNodeMemory(mem); Collection objects = getObjectSource().getNodeMemory(mem); if(tuples!=null) { for(Iterator it=tuples.iterator(); consistent && it.hasNext(); ) { Tuple tuple = (Tuple)it.next(); consistent = objects.contains(tuple.getObject()); } } Object node = this; while(node instanceof IObjectConsumerNode) node = ((IObjectConsumerNode)node).getObjectSource(); ((ReteNode)node).checked.add(this); return consistent; } }
if(node instanceof IObjectConsumerNode) Object next = ((IObjectConsumerNode)node).getObjectSource(); if(!subgraph.contains(next))
test.add(((ITupleConsumerNode)test.get(i)).getTupleSource()); if(test.get(i) instanceof IObjectConsumerNode) test.add(((IObjectConsumerNode)test.get(i)).getObjectSource());
test.add(((ITupleConsumerNode)test.get(i)).getTupleSource()); if(test.get(i) instanceof IObjectConsumerNode) test.add(((IObjectConsumerNode)test.get(i)).getObjectSource());
IObjectSourceNode source = consumer.getObjectSource();
IObjectSourceNode source = consumer.getObjectSource();