Package org.drools.core.util

Examples of org.drools.core.util.RightTupleList


            }
        } else {
            LeftTupleList tupleHashTable = (LeftTupleList) betaMemory.getLeftTupleMemory();
            assertFalse( tupleHashTable.isIndexed() );

            RightTupleList factHashTable = (RightTupleList) betaMemory.getRightTupleMemory();
            assertFalse( factHashTable.isIndexed() );
        }
    }
View Full Code Here


        betaMemory.getRightTupleMemory().add( new RightTuple( fh8, null ) );
        betaMemory.getRightTupleMemory().add( new RightTuple( fh9, null ) );
       
        RightTupleIndexHashTable hashTable = (RightTupleIndexHashTable) betaMemory.getRightTupleMemory();
        // can't create a 0 hashCode, so forcing
        RightTupleList rightTupleList = new RightTupleList();
        rightTupleList.add( new RightTuple( fh10, null) );
        hashTable.getTable()[0] = rightTupleList;
        rightTupleList = new RightTupleList();
        rightTupleList.add( new RightTuple( fh11, null ) );
        rightTupleList.add( new RightTuple( fh12, null ) );
        rightTupleList.add( new RightTuple( fh13, null ) );
        ((RightTupleList)hashTable.getTable()[0]).setNext( rightTupleList );
       
        Entry[] table = hashTable.getTable();
        List list = new ArrayList();
        for ( int i = 0; i < table.length; i++ ) {
View Full Code Here

//            context.writeObject( node.getId() );
        }

        public void execute(InternalWorkingMemory workingMemory) {                       
            DroolsQuery query = (DroolsQuery) factHandle.getObject();
            RightTupleList rightTuples = query.getRightTupleList();
            query.setRightTupleList( null ); // null so further operations happen on a new stack element
           
            for ( RightTuple rightTuple = rightTuples.getFirst(); rightTuple != null; rightTuple = (RightTuple) rightTuple.getNext() ) {
                for( LeftTuple childLeftTuple = rightTuple.firstChild;childLeftTuple != null; childLeftTuple = ( LeftTuple ) childLeftTuple.getRightParentNext() ) {
                  node.getSinkPropagator().doPropagateAssertLeftTuple( context,
                                                                       workingMemory,
                                                                       childLeftTuple,
                                                                       childLeftTuple.getLeftTupleSink() );               
View Full Code Here

            //            context.writeObject( srcVarIndexes );
        }
       
        public void execute(InternalWorkingMemory workingMemory) {
            DroolsQuery query = (DroolsQuery) factHandle.getObject();
            RightTupleList rightTuples = query.getRightTupleList();
            query.setRightTupleList( null ); // null so further operations happen on a new stack element
           
            for ( RightTuple rightTuple = rightTuples.getFirst(); rightTuple != null; rightTuple = (RightTuple) rightTuple.getNext() ) {
              this.node.getSinkPropagator().propagateRetractRightTuple( rightTuple,
                                                                        context,
                                                                        workingMemory );
            }          
        }
View Full Code Here

            //        context.writeObject( srcVarIndexes );
        }

        public void execute(InternalWorkingMemory workingMemory) {
            DroolsQuery query = (DroolsQuery) factHandle.getObject();
            RightTupleList rightTuples = query.getRightTupleList();
            query.setRightTupleList( null ); // null so further operations happen on a new stack element
           
            for ( RightTuple rightTuple = rightTuples.getFirst(); rightTuple != null; rightTuple = (RightTuple) rightTuple.getNext() ) {
                this.node.getSinkPropagator().propagateModifyChildLeftTuple( rightTuple.firstChild,
                                                                             rightTuple.firstChild.getLeftParent(),
                                                                             context,
                                                                             workingMemory,
                                                                             true );
View Full Code Here

            FastIterator it = memory.getRightTupleMemory().fastIterator();

            RightTuple rootBlocker = (RightTuple) it.next(rightTuple);
           
            RightTupleList list = rightTuple.getMemory();
           
           
            // we must do this after we have the next in memory
            // We add to the end to give an opportunity to re-match if in same bucket
            memory.getRightTupleMemory().removeAdd( rightTuple );   
View Full Code Here

            // now process existing blocks, we only process existing and not new from above loop

            FastIterator rightIt = memory.getRightTupleMemory().fastIterator();
            RightTuple rootBlocker = (RightTuple) rightIt.next(rightTuple);
         
            RightTupleList list = rightTuple.getMemory();
           
            // we must do this after we have the next in memory
            // We add to the end to give an opportunity to re-match if in same bucket
            memory.getRightTupleMemory().removeAdd( rightTuple );
View Full Code Here

            }
        } else {
            LeftTupleList tupleHashTable = (LeftTupleList) betaMemory.getLeftTupleMemory();
            assertFalse( tupleHashTable.isIndexed() );

            RightTupleList factHashTable = (RightTupleList) betaMemory.getRightTupleMemory();
            assertFalse( factHashTable.isIndexed() );
        }
    }
View Full Code Here

                                                                         rightTuple,
                                                                         true, // this must always be true, otherwise we can't
                                                                               // find the child tuples to iterate for evaluating the query results
                                                                         query.isOpen() );
           
            RightTupleList rightTuples = query.getRightTupleList();
            if ( rightTuples == null ) {
                rightTuples = new RightTupleList();
                query.setRightTupleList( rightTuples );               
                QueryEvaluationAction evalAction = new QueryEvaluationAction( context,
                                                                              this.factHandle,
                                                                              leftTuple,
                                                                              this.node );
                context.getQueue2().addFirst( evalAction );
            }
           
            rightTuples.addrightTuple );
        }
View Full Code Here

            rightTuple.setLeftTuple( null );
            resultLeftTuple.setBlocker( null );   
           
            DroolsQuery query = (DroolsQuery) this.factHandle.getObject();
           
            RightTupleList rightTuples = query.getRightTupleList();
            if ( rightTuples == null ) {
                rightTuples = new RightTupleList();
                query.setRightTupleList( rightTuples );               
                QueryResultRetractAction retractAction = new QueryResultRetractAction( context,
                                                                                       this.factHandle,
                                                                                       leftTuple,
                                                                                       this.node );
                context.getQueue2().addFirst( retractAction );
            }
           
            rightTuples.addrightTuple );           
        }
View Full Code Here

TOP

Related Classes of org.drools.core.util.RightTupleList

Copyright © 2018 www.massapicom. 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.