Package org.drools.reteoo

Examples of org.drools.reteoo.LeftTuple


                if ( rightTuple.getBlocked() == null ) {
                    return;
                }

                for ( LeftTuple leftTuple = rightTuple.getBlocked(); leftTuple != null; ) {
                    LeftTuple temp = leftTuple.getBlockedNext();

                    leftTuple.clearBlocker();

                    constraints.updateFromTuple( contextEntry,
                                                  wm,
                                                  leftTuple );

                    // we know that older tuples have been checked so continue previously
                    for ( RightTuple newBlocker = rootBlocker; newBlocker != null; newBlocker = (RightTuple) it.next(newBlocker ) ) {
                        if ( constraints.isAllowedCachedLeft( contextEntry,
                                                              newBlocker.getFactHandle() ) ) {
                            leftTuple.setBlocker( newBlocker );
                            newBlocker.addBlocked( leftTuple );

                            break;
                        }
                    }

                    if ( leftTuple.getBlocker() == null ) {
                        // was previous blocked and not in memory, so add
                        ltm.add( leftTuple );

                        LeftTuple childLeftTuple = leftTuple.getFirstChild();
                        while ( childLeftTuple != null ) {
                            childLeftTuple = deleteLeftChild( trgLeftTuples, childLeftTuple, stagedLeftTuples );
                        }
                    }
View Full Code Here


        leftTuple.setMemory( this );
        this.size++;
    }

    public void insertAfter(LeftTuple leftTuple, LeftTuple previous) {
        LeftTuple next = (LeftTuple) previous.getNext();
        previous.setNext(leftTuple);
        leftTuple.setPrevious(previous);
        if (next != null) {
            next.setPrevious(leftTuple);
            leftTuple.setNext(next);
        } else {
            this.last = leftTuple;
        }
        leftTuple.setMemory( this );
View Full Code Here

        leftTuple.setMemory( this );
        this.size++;
    }

    public void insertBefore(LeftTuple leftTuple, LeftTuple next) {
        LeftTuple previous = (LeftTuple) next.getPrevious();
        next.setPrevious(leftTuple);
        leftTuple.setNext(next);
        if (previous != null) {
            previous.setNext(leftTuple);
            leftTuple.setPrevious(previous);
        } else {
            this.first = leftTuple;
        }
        leftTuple.setMemory( this );
View Full Code Here

        leftTuple.setMemory( this );
        this.size++;
    }

    public void remove(final LeftTuple leftTuple) {
        LeftTuple previous = (LeftTuple) leftTuple.getPrevious();
        LeftTuple next = (LeftTuple) leftTuple.getNext();

        if ( previous != null && next != null ) {
            // remove from middle
            previous.setNext( next );
            next.setPrevious( previous );
        } else if ( next != null ) {
            // remove from first
            this.first = next;
            next.setPrevious( null );
        } else if ( previous != null ) {
            // remove from end
            this.last = previous;
            previous.setNext( null );
        } else {
View Full Code Here

    public boolean contains(final LeftTuple leftTuple) {
        return get( leftTuple ) != null;
    }

    public Object get(final LeftTuple leftTtuple) {
        LeftTuple current = this.first;
        while ( current != null ) {
            if ( leftTtuple.equals( current ) ) {
                return current;
            }
            current = (LeftTuple) current.getNext();
        }
        return null;
    }
View Full Code Here

    }

    public LeftTuple[] toArray() {
        LeftTuple[] tuples = new LeftTuple[this.size];

        LeftTuple current = first;
        for ( int i = 0; i < this.size; i++ ) {
            tuples[i] = current;
            current = (LeftTuple) current.getNext();
        }

        return tuples;
    }
View Full Code Here

            this.current = first;
        }

        public Object next() {
            if ( this.current != null ) {
                LeftTuple returnValue = this.current;
                this.current = (LeftTuple) current.getNext();
                return returnValue;
            } else {
                return null;
            }
View Full Code Here

        public void doLeftInserts(RuleTerminalNode rtnNode,
                                  InternalWorkingMemory wm,
                                  StagedLeftTuples srcLeftTuples) {

            for ( LeftTuple leftTuple = srcLeftTuples.getInsertFirst(); leftTuple != null; ) {
                LeftTuple next = leftTuple.getStagedNext();
                rtnNode.assertLeftTuple( leftTuple, leftTuple.getPropagationContext(), wm );
                leftTuple.clearStaged();
                leftTuple = next;
            }
            srcLeftTuples.setInsert( null, 0 );
View Full Code Here

        public void doLeftUpdates(RuleTerminalNode rtnNode,
                                  InternalWorkingMemory wm,
                                  StagedLeftTuples srcLeftTuples) {

            for ( LeftTuple leftTuple = srcLeftTuples.getUpdateFirst(); leftTuple != null; ) {
                LeftTuple next = leftTuple.getStagedNext();
                rtnNode.modifyLeftTuple( leftTuple, leftTuple.getPropagationContext(), wm );
                leftTuple.clearStaged();
                leftTuple = next;
            }
            srcLeftTuples.setUpdate( null );
View Full Code Here

        public void doLeftDeletes(RuleTerminalNode rtnNode,
                                  InternalWorkingMemory wm,
                                  StagedLeftTuples srcLeftTuples) {

            for ( LeftTuple leftTuple = srcLeftTuples.getDeleteFirst(); leftTuple != null; ) {
                LeftTuple next = leftTuple.getStagedNext();
                rtnNode.retractLeftTuple( leftTuple, leftTuple.getPropagationContext(), wm );
                leftTuple.clearStaged();
                leftTuple = next;
            }
            srcLeftTuples.setDelete( null );
View Full Code Here

TOP

Related Classes of org.drools.reteoo.LeftTuple

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.