Package org.drools.core.util.index

Examples of org.drools.core.util.index.RightTupleList


            throw new UnsupportedOperationException("Should not be present in network on serialisation");
        }

        public void execute(InternalWorkingMemory workingMemory) {
            DroolsQuery query = (DroolsQuery) factHandle.getObject();
            RightTupleList rightTuples = query.getResultUpdateRightTupleList();
            query.setResultUpdateRightTupleList(null); // null so further operations happen on a new stack element

            for (RightTuple rightTuple = rightTuples.getFirst(); rightTuple != null; ) {
                RightTuple tmp = (RightTuple) rightTuple.getNext();
                rightTuples.remove(rightTuple);
                this.node.getSinkPropagator().propagateModifyChildLeftTuple(rightTuple.firstChild,
                                                                            rightTuple.firstChild.getLeftParent(),
                                                                            context,
                                                                            workingMemory,
                                                                            true);
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

            throw new UnsupportedOperationException("Should not be present in network on serialisation");
        }

        public void execute(InternalWorkingMemory workingMemory) {
            DroolsQuery query = (DroolsQuery) factHandle.getObject();
            RightTupleList rightTuples = query.getResultInsertRightTupleList();
            query.setResultInsertRightTupleList(null); // null so further operations happen on a new stack element

            for (RightTuple rightTuple = rightTuples.getFirst(); rightTuple != null; ) {
                RightTuple tmp = (RightTuple) rightTuple.getNext();
                rightTuples.remove(rightTuple);
                for (LeftTuple childLeftTuple = rightTuple.firstChild; childLeftTuple != null; childLeftTuple = (LeftTuple) childLeftTuple.getRightParentNext()) {
                    node.getSinkPropagator().doPropagateAssertLeftTuple(context,
                                                                        workingMemory,
                                                                        childLeftTuple,
                                                                        childLeftTuple.getLeftTupleSink());
View Full Code Here

            throw new UnsupportedOperationException("Should not be present in network on serialisation");
        }

        public void execute(InternalWorkingMemory workingMemory) {
            DroolsQuery query = (DroolsQuery) factHandle.getObject();
            RightTupleList rightTuples = query.getResultRetractRightTupleList();
            query.setResultRetractRightTupleList(null); // null so further operations happen on a new stack element

            for (RightTuple rightTuple = rightTuples.getFirst(); rightTuple != null; ) {
                RightTuple tmp = (RightTuple) rightTuple.getNext();
                rightTuples.remove(rightTuple);
                this.node.getSinkPropagator().propagateRetractRightTuple(rightTuple,
                                                                         context,
                                                                         workingMemory);
                rightTuple = tmp;
            }
View Full Code Here

            throw new UnsupportedOperationException("Should not be present in network on serialisation");
        }

        public void execute(InternalWorkingMemory workingMemory) {
            DroolsQuery query = (DroolsQuery) factHandle.getObject();
            RightTupleList rightTuples = query.getResultUpdateRightTupleList();
            query.setResultUpdateRightTupleList(null); // null so further operations happen on a new stack element

            for (RightTuple rightTuple = rightTuples.getFirst(); rightTuple != null; ) {
                RightTuple tmp = (RightTuple) rightTuple.getNext();
                rightTuples.remove(rightTuple);
                this.node.getSinkPropagator().propagateModifyChildLeftTuple(rightTuple.firstChild,
                                                                            rightTuple.firstChild.getLeftParent(),
                                                                            context,
                                                                            workingMemory,
                                                                            true);
View Full Code Here

        boolean resumeFromCurrent =  !(indexedUnificationJoin || rightTupleMemory.getIndexType().isComparison());

        FastIterator rightIt = null;
        RightTuple rootBlocker = null;
        if ( resumeFromCurrent ) {
            RightTupleList currentRtm = rightTuple.getMemory();
            rightIt = currentRtm.fastIterator(); // only needs to iterate the current bucket, works for equality indexed and non indexed.
            rootBlocker = (RightTuple) rightTuple.getNext();

            if ( removeAdd ) {
                // 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
View Full Code Here

                                                                            rightTuple,
                                                                            true, // this must always be true, otherwise we can't
                                                                            // find the child tuples to iterate for evaluating the dquery results
                                                                            dquery.isOpen());
               
                RightTupleList rightTuples = dquery.getResultInsertRightTupleList();
                if ( rightTuples == null ) {
                    rightTuples = new RightTupleList();
                    dquery.setResultInsertRightTupleList(rightTuples);
                    QueryResultInsertAction evalAction = new QueryResultInsertAction( context,
                                                                                      this.factHandle,
                                                                                      leftTuple,
                                                                                      this.node );
                    context.getQueue2().addFirst( evalAction );
                }

                rightTuples.add( rightTuple );               
            }


        }
View Full Code Here

                }
                leftTuples.addDelete( childLeftTuple  );
                return;
            }

            RightTupleList rightTuples = query.getResultRetractRightTupleList();
            if ( rightTuples == null ) {
                rightTuples = new RightTupleList();
                query.setResultRetractRightTupleList( rightTuples );
                QueryResultRetractAction retractAction = new QueryResultRetractAction( context,
                                                                                       this.factHandle,
                                                                                       leftTuple,
                                                                                       this.node );
                context.getQueue2().addFirst( retractAction );
            }
            if ( rightTuple.getMemory() != null ) {
                throw new RuntimeException();
            }
            rightTuples.add( rightTuple );
        }
View Full Code Here

                return;
            }

            // Don't need to recreate child links, as they will already be there form the first "add"

            RightTupleList rightTuples = dquery.getResultUpdateRightTupleList();
            if ( rightTuples == null ) {
                rightTuples = new RightTupleList();
                dquery.setResultUpdateRightTupleList(rightTuples);
                QueryResultUpdateAction updateAction = new QueryResultUpdateAction( context,
                                                                                    this.factHandle,
                                                                                    leftTuple,
                                                                                    this.node );
                context.getQueue2().addFirst( updateAction );
            }
            rightTuples.add( rightTuple );
        }
View Full Code Here

        boolean resumeFromCurrent =  !(indexedUnificationJoin || rightTupleMemory.getIndexType().isComparison());

        FastIterator rightIt = null;
        RightTuple rootBlocker = null;
        if ( resumeFromCurrent ) {
            RightTupleList currentRtm = rightTuple.getMemory();
            rightIt = currentRtm.fastIterator(); // only needs to iterate the current bucket, works for equality indexed and non indexed.
            rootBlocker = (RightTuple) rightTuple.getNext();

            if ( removeAdd ) {
                // 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
View Full Code Here

TOP

Related Classes of org.drools.core.util.index.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.