Package org.drools.core.util

Examples of org.drools.core.util.Iterator


                           final InternalWorkingMemory workingMemory) {

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

        FastIterator rightIter = LinkedList.fastIterator;
        final Iterator tupleIter = memory.betaMemory.getLeftTupleMemory().iterator();
        for ( LeftTuple leftTuple = (LeftTuple) tupleIter.next(); leftTuple != null; leftTuple = (LeftTuple) tupleIter.next() ) {
            Map<Object, RightTuple> matches = (Map<Object, RightTuple>) leftTuple.getObject();
            for ( RightTuple rightTuples : matches.values() ) {
                for ( RightTuple rightTuple = rightTuples; rightTuple != null; rightTuple = (RightTuple) rightIter.next( rightTuples ) ) {
                    boolean isAllowed = true;
                    if ( this.alphaConstraints != null ) {
View Full Code Here


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

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

        final Iterator tupleIter = memory.getLeftTupleMemory().iterator();
        for ( LeftTuple leftTuple = (LeftTuple) tupleIter.next(); leftTuple != null; leftTuple = (LeftTuple) tupleIter.next() ) {
            this.constraints.updateFromTuple( memory.getContext(),
                                              workingMemory,
                                              leftTuple );
            for ( RightTuple rightTuple = memory.getRightTupleMemory().getFirst( leftTuple,
                                                                                 (InternalFactHandle) context.getFactHandle() ); rightTuple != null; rightTuple = (RightTuple) it.next( rightTuple ) ) {
View Full Code Here

                                                e );
        }
    }
   
    private LeftTuple getFirst(LeftTupleMemory memory, LeftTuple leftTuple) {
        Iterator it = memory.iterator();
        for ( LeftTuple next = ( LeftTuple ) it.next(); next != null; next = ( LeftTuple ) it.next() ) {
          if (next.equals( leftTuple ) ) {
              return next.getMemory().getFirst();
          }           
        }
       
View Full Code Here

       
        return null;
    }   
   
    private RightTuple  getFirst(RightTupleMemory memory, RightTuple rightTuple) {
        Iterator it = memory.iterator();
        for ( RightTuple next = (RightTuple) it.next( ); next != null; next = ( RightTuple ) it.next()) {
            if (next.equals( rightTuple ) ) {
                return next.getMemory().getFirst();
            }
        }
       
View Full Code Here

    private String print(LeftTupleMemory leftMemory,
                         boolean lrUnlinkingEnabled) {

        List<LeftTuple> tuples = new ArrayList<LeftTuple>();
        Iterator it = leftMemory.iterator();
        for ( LeftTuple tuple = (LeftTuple) it.next(); tuple != null; tuple = (LeftTuple) it
                .next() ) {
            tuples.add( tuple );
        }

        if ( lrUnlinkingEnabled ) {
View Full Code Here

    }

    private String print(RightTupleMemory memory) {

        List<RightTuple> tuples = new ArrayList<RightTuple>();
        Iterator it = memory.iterator();

        for ( RightTuple tuple = (RightTuple) it.next(); tuple != null; tuple = (RightTuple) it
                .next() ) {
            tuples.add( tuple );
        }

        return "[" + print( tuples ) + "]";
View Full Code Here

                    }

                    // get actual tuples
                    final List<LeftTuple> actualTuples = new ArrayList<LeftTuple>();
                    final Iterator it = memory.iterator();
                    for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) {
                        actualTuples.add( (LeftTuple) entry.getKey() );
                    }

                    // iterate over expected tuples and compare with actual tuples
                    for ( LeftTuple tuple : leftTuples ) {
View Full Code Here

       
       
        //System.out.println( entries );

        list = new ArrayList<LeftTupleImpl>();
        Iterator it = betaMemory.getRightTupleMemory().iterator();
        for ( RightTuple rightTuple = ( RightTuple ) it.next(); rightTuple != null; rightTuple = ( RightTuple ) it.next() ) {
            list.add( rightTuple );
        }
       
        assertEquals( 13, list.size() );
            
View Full Code Here

                                                e );
        }
    }
   
    private LeftTuple getFirst(LeftTupleMemory memory, LeftTuple leftTuple) {
        Iterator it = memory.iterator();
        for ( LeftTuple next = ( LeftTuple ) it.next(); next != null; next = ( LeftTuple ) it.next() ) {
          if (next.equals( leftTuple ) ) {
              return next.getMemory().getFirst();
          }           
        }
       
View Full Code Here

       
        return null;
    }   
   
    private RightTuple  getFirst(RightTupleMemory memory, RightTuple rightTuple) {
        Iterator it = memory.iterator();
        for ( RightTuple next = (RightTuple) it.next( ); next != null; next = ( RightTuple ) it.next()) {
            if (next.equals( rightTuple ) ) {
                return next.getMemory().getFirst();
            }
        }
       
View Full Code Here

TOP

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

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.