Package org.drools.util

Examples of org.drools.util.FactHashTable


            this.sink.createAndPropagateAssertTuple( handle,
                                                     context,
                                                     workingMemory );

            if ( this.hasMemory ) {
                final FactHashTable memory = (FactHashTable) workingMemory.getNodeMemory( this );
                memory.add( handle,
                            false );
            }
        } else {
            workingMemory.addLIANodePropagation( new LIANodePropagation(this, handle, context) );
        }
View Full Code Here


    public void retractObject(final InternalFactHandle handle,
                              final PropagationContext context,
                              final InternalWorkingMemory workingMemory) {
        boolean propagate = true;
        if ( this.hasMemory ) {
            final FactHashTable memory = (FactHashTable) workingMemory.getNodeMemory( this );
            propagate = memory.remove( handle );
        }

        if ( propagate ) {
            this.sink.createAndPropagateRetractTuple( handle,
                                                      context,
View Full Code Here

    public void updateSink(final TupleSink sink,
                           final PropagationContext context,
                           final InternalWorkingMemory workingMemory) {
        if ( this.hasMemory ) {
            // We have memory so iterate over all entries
            final FactHashTable memory = (FactHashTable) workingMemory.getNodeMemory( this );
            final Iterator it = memory.iterator();
            for ( FactEntry entry = (FactEntry) it.next(); entry != null; entry = (FactEntry) it.next() ) {
                final InternalFactHandle handle = entry.getFactHandle();
                sink.assertTuple( new ReteTuple( handle ),
                                  context,
                                  workingMemory );
View Full Code Here

        return this.objectSource.equals( other.objectSource ); //&& this.constraints.equals( other.constraints );
        //        }
    }

    public Object createMemory(final RuleBaseConfiguration config) {
        return new FactHashTable();
    }
View Full Code Here

                             final PropagationContext context,
                             final InternalWorkingMemory workingMemory) throws FactException {
        if ( this.constraint.isAllowed( handle.getObject(),
                                        workingMemory ) ) {
            if ( hasMemory()  && !workingMemory.isSequential() ) {
                final FactHashTable memory = (FactHashTable) workingMemory.getNodeMemory( this );
                memory.add( handle,
                            false );
            }
           
            this.sink.propagateAssertObject( handle,
                                             context,
View Full Code Here

    public void retractObject(final InternalFactHandle handle,
                              final PropagationContext context,
                              final InternalWorkingMemory workingMemory) {
        boolean propagate = true;
        if ( hasMemory() ) {
            final FactHashTable memory = (FactHashTable) workingMemory.getNodeMemory( this );
            propagate = memory.remove( handle );
        } else {
            propagate = this.constraint.isAllowed( handle.getObject(),
                                                   workingMemory );
        }
        if ( propagate ) {
View Full Code Here

    }

    public void updateSink(final ObjectSink sink,
                           final PropagationContext context,
                           final InternalWorkingMemory workingMemory) {
        FactHashTable memory = null;

        if ( !hasMemory() ) {
            // get the objects from the parent
            this.objectSource.updateSink( sink,
                                          context,
                                          workingMemory );
        } else {
            // if already has memory, just iterate and propagate
            memory = (FactHashTable) workingMemory.getNodeMemory( this );
            final Iterator it = memory.iterator();
            for ( FactEntry entry = (FactEntry) it.next(); entry != null; entry = (FactEntry) it.next() ) {
                sink.assertObject( entry.getFactHandle(),
                                   context,
                                   workingMemory );
            }
View Full Code Here

    /**
     * Creates a HashSet for the AlphaNode's memory.
     */
    public Object createMemory(final RuleBaseConfiguration config) {
        return new FactHashTable();
    }
View Full Code Here

        for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) {
            ObjectTypeConf objectTypeConf = (ObjectTypeConf) entry.getValue();
            if ( newObjectType.isAssignableFrom( objectTypeConf.getConcreteObjectTypeNode().getObjectType() ) ) {
                objectTypeConf.resetCache();
                ObjectTypeNode sourceNode = objectTypeConf.getConcreteObjectTypeNode();
                FactHashTable table = (FactHashTable) workingMemory.getNodeMemory( sourceNode );
                Iterator factIter = table.iterator();
                for ( FactEntry factEntry = (FactEntry) factIter.next(); factEntry != null; factEntry = (FactEntry) factIter.next() ) {
                    sink.assertObject( factEntry.getFactHandle(),
                                       context,
                                       workingMemory );
                }
View Full Code Here

        for ( ObjectEntry entry = (ObjectEntry) it.next(); entry != null; entry = (ObjectEntry) it.next() ) {
            ObjectTypeConf objectTypeConf = (ObjectTypeConf) entry.getValue();
            if ( newObjectType.isAssignableFrom( objectTypeConf.getConcreteObjectTypeNode().getObjectType() ) ) {
                objectTypeConf.resetCache();
                ObjectTypeNode sourceNode = objectTypeConf.getConcreteObjectTypeNode();
                FactHashTable table = (FactHashTable) workingMemory.getNodeMemory( sourceNode );
                Iterator factIter = table.iterator();
                for ( FactEntry factEntry = (FactEntry) factIter.next(); factEntry != null; factEntry = (FactEntry) factIter.next() ) {
                    sink.assertObject( factEntry.getFactHandle(),
                                       context,
                                       workingMemory );
                }
View Full Code Here

TOP

Related Classes of org.drools.util.FactHashTable

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.