Examples of TupleHashTable


Examples of org.drools.util.TupleHashTable

     */
    public void updateSink(final TupleSink sink,
                           final PropagationContext context,
                           final InternalWorkingMemory workingMemory) {

        final TupleHashTable memory = (TupleHashTable) workingMemory.getNodeMemory( this );

        final Iterator it = memory.iterator();
        for ( ReteTuple tuple = (ReteTuple) it.next(); tuple != null; tuple = (ReteTuple) it.next() ) {
            sink.assertTuple( tuple,
                              context,
                              workingMemory );
        }
View Full Code Here

Examples of org.drools.util.TupleHashTable

            }
        }
    }

    public Object createMemory(final RuleBaseConfiguration config) {
        return new BetaMemory( new TupleHashTable(),
                               null );
    }
View Full Code Here

Examples of org.drools.util.TupleHashTable

        final EvalConditionNode node = new EvalConditionNode( 18,
                                                              source,
                                                              new MockEvalCondition( true ),
                                                              buildContext );

        final TupleHashTable memory = (TupleHashTable) workingMemory.getNodeMemory( node );

        assertNotNull( memory );
    }
View Full Code Here

Examples of org.drools.util.TupleHashTable

        node.assertTuple( tuple1,
                          this.context,
                          this.workingMemory );

        // Check memory was populated
        final TupleHashTable memory = (TupleHashTable) this.workingMemory.getNodeMemory( node );

        assertEquals( 2,
                      memory.size() );

        assertTrue( memory.contains( tuple0 ) );
        assertTrue( memory.contains( tuple1 ) );

        // make sure assertions were propagated
        assertEquals( 2,
                      sink.getAsserted().size() );
    }
View Full Code Here

Examples of org.drools.util.TupleHashTable

        node.assertTuple( tuple1,
                          this.context,
                          this.workingMemory );

        // Check memory was populated
        final TupleHashTable memory = (TupleHashTable) this.workingMemory.getNodeMemory( node );

        assertEquals( 2,
                      memory.size() );
        assertTrue( memory.contains( tuple0 ) );
        assertTrue( memory.contains( tuple1 ) );

        // make sure assertions were propagated
        assertEquals( 2,
                      sink.getAsserted().size() );

        // Now test that the fact is retracted correctly
        node.retractTuple( tuple0,
                           this.context,
                           this.workingMemory );

        // Now test that the fact is retracted correctly
        assertEquals( 1,
                      memory.size() );

        assertTrue( memory.contains( tuple1 ) );

        // make sure retractions were propagated
        assertEquals( 1,
                      sink.getRetracted().size() );

        // Now test that the fact is retracted correctly
        node.retractTuple( tuple1,
                           this.context,
                           this.workingMemory );

        // Now test that the fact is retracted correctly
        assertEquals( 0,
                      memory.size() );

        // make sure retractions were propagated
        assertEquals( 2,
                      sink.getRetracted().size() );
    }
View Full Code Here

Examples of org.drools.util.TupleHashTable

        node.assertTuple( tuple1,
                          this.context,
                          this.workingMemory );

        // Check memory was not populated
        final TupleHashTable memory = (TupleHashTable) this.workingMemory.getNodeMemory( node );

        assertEquals( 0,
                      memory.size() );

        // test no propagations
        assertEquals( 0,
                      sink.getAsserted().size() );
        assertEquals( 0,
View Full Code Here

Examples of org.drools.util.TupleHashTable

        final EvalConditionNode node = new EvalConditionNode( 18,
                                                              source,
                                                              new MockEvalCondition( true ) );

        final TupleHashTable memory = (TupleHashTable) workingMemory.getNodeMemory( node );

        assertNotNull( memory );
    }
View Full Code Here

Examples of org.drools.util.TupleHashTable

        node.assertTuple( tuple1,
                          this.context,
                          this.workingMemory );

        // Check memory was populated
        final TupleHashTable memory = (TupleHashTable) this.workingMemory.getNodeMemory( node );

        assertEquals( 2,
                      memory.size() );

        assertTrue( memory.contains( tuple0 ) );
        assertTrue( memory.contains( tuple1 ) );

        // make sure assertions were propagated
        assertEquals( 2,
                      sink.getAsserted().size() );
    }
View Full Code Here

Examples of org.drools.util.TupleHashTable

        node.assertTuple( tuple1,
                          this.context,
                          this.workingMemory );

        // Check memory was populated
        final TupleHashTable memory = (TupleHashTable) this.workingMemory.getNodeMemory( node );

        assertEquals( 2,
                      memory.size() );
        assertTrue( memory.contains( tuple0 ) );
        assertTrue( memory.contains( tuple1 ) );

        // make sure assertions were propagated
        assertEquals( 2,
                      sink.getAsserted().size() );

        // Now test that the fact is retracted correctly
        node.retractTuple( tuple0,
                           this.context,
                           this.workingMemory );

        // Now test that the fact is retracted correctly
        assertEquals( 1,
                      memory.size() );

        assertTrue( memory.contains( tuple1 ) );

        // make sure retractions were propagated
        assertEquals( 1,
                      sink.getRetracted().size() );

        // Now test that the fact is retracted correctly
        node.retractTuple( tuple1,
                           this.context,
                           this.workingMemory );

        // Now test that the fact is retracted correctly
        assertEquals( 0,
                      memory.size() );

        // make sure retractions were propagated
        assertEquals( 2,
                      sink.getRetracted().size() );
    }
View Full Code Here

Examples of org.drools.util.TupleHashTable

        node.assertTuple( tuple1,
                          this.context,
                          this.workingMemory );

        // Check memory was not populated
        final TupleHashTable memory = (TupleHashTable) this.workingMemory.getNodeMemory( node );

        assertEquals( 0,
                      memory.size() );

        // test no propagations
        assertEquals( 0,
                      sink.getAsserted().size() );
        assertEquals( 0,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.