Examples of ReteTuple


Examples of org.drools.reteoo.ReteTuple

        final RuleBase ruleBase = RuleBaseFactory.newRuleBase();
        final WorkingMemory wm = ruleBase.newStatefulSession();

        final Person p = new Person("mark", "", 31);
        final InternalFactHandle f0 = (InternalFactHandle) wm.insert( p );
        final ReteTuple tuple = new ReteTuple( f0 );

        SalienceBuilder salienceBuilder = new MVELSalienceBuilder();
        salienceBuilder.build( context );
               
        assertEquals( 51, context.getRule().getSalience().getValue( tuple, wm ) );
View Full Code Here

Examples of org.drools.reteoo.ReteTuple

    }

    public boolean isAllowedCachedLeft(final ContextEntry context,
                                       final Object object) {
        // object MUST be a ReteTuple
        final ReteTuple tuple = ((ReteTuple) object).getSubTuple( ((TupleStartEqualsConstraintContextEntry) context).compareSize );
        return ((TupleStartEqualsConstraintContextEntry) context).left.equals( tuple );
    }
View Full Code Here

Examples of org.drools.reteoo.ReteTuple

    }

    public boolean isAllowedCachedLeft(final ContextEntry context,
                                       final Object object) {
        // object MUST be a ReteTuple
        final ReteTuple tuple = ((ReteTuple) object).getSubTuple( ((TupleStartEqualsConstraintContextEntry) context).compareSize );
        return ((TupleStartEqualsConstraintContextEntry) context).left.equals( tuple );
    }
View Full Code Here

Examples of org.drools.reteoo.ReteTuple

        FieldIndexEntry current = previous;
        while ( current != null ) {
            final FieldIndexEntry next = (FieldIndexEntry) current.next;
            if ( current.matches( tuple,
                                  hashCode ) ) {
                final ReteTuple old = current.remove( tuple );
                this.factSize--;
                // If the FactEntryIndex is empty, then remove it from the hash table
                if ( current.first == null ) {
                    if ( previous == current ) {
                        this.table[index] = next;
View Full Code Here

Examples of org.drools.reteoo.ReteTuple

            tuple.setNext( this.first );
            this.first = tuple;
        }

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

Examples of org.drools.reteoo.ReteTuple

            }
            return null;
        }

        public ReteTuple remove(final ReteTuple tuple) {
            ReteTuple previous = this.first;
            ReteTuple current = previous;
            while ( current != null ) {
                final ReteTuple next = (ReteTuple) current.getNext();
                if ( tuple.equals( current ) ) {
                    if ( this.first == current ) {
                        this.first = next;
                    } else {
                        previous.setNext( next );
View Full Code Here

Examples of org.drools.reteoo.ReteTuple

    public ReteTuple get(final ReteTuple tuple) {
        final int hashCode = tuple.hashCode();
        final int index = indexOf( hashCode,
                                   this.table.length );

        ReteTuple current = (ReteTuple) this.table[index];
        while ( current != null ) {
            if ( hashCode == current.hashCode() && tuple.equals( current ) ) {
                return current;
            }
            current = (ReteTuple) current.getNext();
        }
        return null;
    }
View Full Code Here

Examples of org.drools.reteoo.ReteTuple

    public ReteTuple remove(final ReteTuple tuple) {
        final int hashCode = tuple.hashCode();
        final int index = indexOf( hashCode,
                                   this.table.length );

        ReteTuple previous = (ReteTuple) this.table[index];
        ReteTuple current = previous;
        while ( current != null ) {
            final ReteTuple next = (ReteTuple) current.getNext();
            if ( hashCode == current.hashCode() && tuple.equals( current ) ) {
                if ( previous == current ) {
                    this.table[index] = next;
                } else {
                    previous.setNext( next );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.