Package org.drools.spi

Examples of org.drools.spi.AlphaNodeFieldConstraint


                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];
        AlphaNodeFieldConstraint constraint = alphanode.getConstraint();

        if (constraint instanceof LiteralConstraint) {
            assertTrue( (( LiteralConstraint )constraint).getFieldExtractor() instanceof ClassFieldReader );
            FieldValue r = (( LiteralConstraint )constraint).getField();
            assertEquals( p.getAddress(), r.getValue() );
View Full Code Here


                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];       
        AlphaNodeFieldConstraint constraint = alphanode.getConstraint();

        if (constraint instanceof LiteralConstraint) {
            assertTrue( (( LiteralConstraint )constraint).getFieldExtractor() instanceof MVELClassFieldReader );
            assertEquals( new Address("s1"), (( LiteralConstraint )constraint).getField().getValue() );
        }
View Full Code Here

                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];       
        AlphaNodeFieldConstraint constraint = alphanode.getConstraint();

        if (constraint instanceof LiteralConstraint) {
            assertTrue( (( LiteralConstraint ) alphanode.getConstraint()).getFieldExtractor() instanceof MVELClassFieldReader );
            assertEquals( new Address("s1"), (( LiteralConstraint ) alphanode.getConstraint()).getField().getValue() );
        }
View Full Code Here

                break;
            }
        }
       
        AlphaNode alphanode = (AlphaNode) node.getSinkPropagator().getSinks()[0];       
        AlphaNodeFieldConstraint constraint = alphanode.getConstraint();

        if (constraint instanceof LiteralConstraint) {
            assertTrue( (( LiteralConstraint ) alphanode.getConstraint()).getFieldExtractor() instanceof MVELClassFieldReader );
            assertEquals( new Address("s1"), (( LiteralConstraint ) alphanode.getConstraint()).getField().getValue() );
        }
View Full Code Here

        assertTrue( c.getPredicateExpression() instanceof PredicateExpression );
        assertTrue( c.getPredicateExpression() instanceof CompiledInvoker );
        assertTrue( !(c.getPredicateExpression() instanceof MVELPredicateExpression ) );
       
        alphanode = (AlphaNode) alphanode.getSinkPropagator().getSinks()[0];
        AlphaNodeFieldConstraint constraint = alphanode.getConstraint();

        if (constraint instanceof LiteralConstraint) {
            FieldValue fieldVal = (( LiteralConstraint ) constraint).getField();
            assertEquals( "xxx", fieldVal.getValue() );
        }
View Full Code Here

    }

    public void addObjectSink(final ObjectSink sink) {
        if ( sink instanceof AlphaNode ) {
            final AlphaNode alphaNode = (AlphaNode) sink;
            final AlphaNodeFieldConstraint fieldConstraint = alphaNode.getConstraint();

            if ( fieldConstraint instanceof LiteralConstraint ) {
                final LiteralConstraint literalConstraint = (LiteralConstraint) fieldConstraint;
                final Evaluator evaluator = literalConstraint.getEvaluator();
View Full Code Here

    }

    public void removeObjectSink(final ObjectSink sink) {
        if ( sink instanceof AlphaNode ) {
            final AlphaNode alphaNode = (AlphaNode) sink;
            final AlphaNodeFieldConstraint fieldConstraint = alphaNode.getConstraint();

            if ( fieldConstraint instanceof LiteralConstraint ) {
                final LiteralConstraint literalConstraint = (LiteralConstraint) fieldConstraint;
                final Evaluator evaluator = literalConstraint.getEvaluator();
                final FieldValue value = literalConstraint.getField();
View Full Code Here

            this.hashedSinkMap = new ObjectHashMap();
        }

        for ( ObjectSinkNode sink = this.hashableSinks.getFirst(); sink != null; sink = sink.getNextObjectSinkNode() ) {
            final AlphaNode alphaNode = (AlphaNode) sink;
            final AlphaNodeFieldConstraint fieldConstraint = alphaNode.getConstraint();
            final LiteralConstraint literalConstraint = (LiteralConstraint) fieldConstraint;
            final Evaluator evaluator = literalConstraint.getEvaluator();
            if ( evaluator.getOperator() == Operator.EQUAL && index == literalConstraint.getFieldExtractor().getIndex() ) {
                final FieldValue value = literalConstraint.getField();
                list.add( sink );
View Full Code Here

        }

        for ( final java.util.Iterator iter = sinks.iterator(); iter.hasNext(); ) {
            final AlphaNode sink = (AlphaNode) iter.next();
            final AlphaNode alphaNode = sink;
            final AlphaNodeFieldConstraint fieldConstraint = alphaNode.getConstraint();
            final LiteralConstraint literalConstraint = (LiteralConstraint) fieldConstraint;
            final Evaluator evaluator = literalConstraint.getEvaluator();
            if ( evaluator.getOperator() == Operator.EQUAL && index == literalConstraint.getFieldExtractor().getIndex() ) {
                final FieldValue value = literalConstraint.getField();
                if ( this.hashableSinks == null ) {
View Full Code Here

                                                                                      pattern.getObjectType(),
                                                                                      context.getRuleBase().getRete(),
                                                                                      context.getRuleBase().getConfiguration().getAlphaNodeHashingThreshold() ) ) );

        for ( final Iterator it = alphaConstraints.iterator(); it.hasNext(); ) {
            final AlphaNodeFieldConstraint constraint = (AlphaNodeFieldConstraint) it.next();

            context.setObjectSource( (ObjectSource) utils.attachNode( context,
                                                                      new AlphaNode( context.getNextId(),
                                                                                     (AlphaNodeFieldConstraint) constraint,
                                                                                     context.getObjectSource(),
View Full Code Here

TOP

Related Classes of org.drools.spi.AlphaNodeFieldConstraint

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.