Package org.drools.util

Examples of org.drools.util.FactHashTable


            FactHandleMemory factHandleMemory;
            if ( config.isIndexRightBetaMemory() ) {
                factHandleMemory = new FactHandleIndexHashTable( indexes );
            } else {
                factHandleMemory = config.isSequential() ? (FactHandleMemory) new FactList() : (FactHandleMemory) new FactHashTable();
            }
            memory = new BetaMemory( config.isSequential() ? null : tupleMemory,
                                     factHandleMemory );
        } else {
            memory = new BetaMemory( config.isSequential() ? null : new TupleHashTable(),
                                     config.isSequential() ? (FactHandleMemory) new FactList() : (FactHandleMemory) new FactHashTable() );
        }

        return memory;
    }
View Full Code Here


        return true;
    }

    public BetaMemory createBetaMemory(final RuleBaseConfiguration config) {
        final BetaMemory memory = new BetaMemory( config.isSequential() ? null : new TupleHashTable(),
                                                  config.isSequential() ? (FactHandleMemory) new FactList() : (FactHandleMemory) new FactHashTable() );

        return memory;
    }
View Full Code Here

            FactHandleMemory factHandleMemory;
            if ( this.conf.isIndexRightBetaMemory() ) {
                factHandleMemory = new FactHandleIndexHashTable( new FieldIndex[]{index} );
            } else {
                factHandleMemory = new FactHashTable();
            }
            memory = new BetaMemory( config.isSequential() ? null : tupleMemory,
                                     factHandleMemory );
        } else {
            memory = new BetaMemory( config.isSequential() ? null : new TupleHashTable(),
                                     new FactHashTable() );
        }

        return memory;
    }
View Full Code Here

            FactHandleMemory factHandleMemory;
            if ( conf.isIndexRightBetaMemory() ) {
                factHandleMemory = new FactHandleIndexHashTable( indexes );
            } else {
                factHandleMemory = conf.isSequential() ? (FactHandleMemory) new FactList() : (FactHandleMemory) new FactHashTable();
            }
            memory = new BetaMemory( conf.isSequential() ? null : tupleMemory,
                                     factHandleMemory );
        } else {
            memory = new BetaMemory( conf.isSequential() ? null : new TupleHashTable(),
                                     conf.isSequential() ? (FactHandleMemory) new FactList() : (FactHandleMemory) new FactHashTable() );
        }

        return memory;
    }
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

            // we do this after the shadowproxy update, just so that its up to date for the future
            return;
        }

        if ( !workingMemory.isSequential() ) {
            final FactHashTable memory = (FactHashTable) workingMemory.getNodeMemory( this );
            memory.add( handle,
                        false );
        }

        this.sink.propagateAssertObject( handle,
                                         context,
View Full Code Here

        if ( context.getType() == PropagationContext.MODIFICATION && this.skipOnModify && context.getDormantActivations() == 0 ) {
            return;
        }

        final FactHashTable memory = (FactHashTable) workingMemory.getNodeMemory( this );
        memory.remove( handle );

        this.sink.propagateRetractObject( handle,
                                          context,
                                          workingMemory,
                                          true );
View Full Code Here

    }

    public void updateSink(final ObjectSink sink,
                           final PropagationContext context,
                           final InternalWorkingMemory workingMemory) {
        final FactHashTable 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 memory for the node using PrimitiveLongMap as its optimised for storage and reteivals of Longs.
     * However PrimitiveLongMap is not ideal for spase data. So it should be monitored incase its more optimal
     * to switch back to a standard HashMap.
     */
    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

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.