Examples of BitMask


Examples of org.drools.core.util.bitmask.BitMask

    public void resetInferredMask() {
        this.inferredMask = EmptyBitMask.get();
    }
   
    public BitMask updateMask(BitMask mask) {
        BitMask returnMask;
        if ( source.getType() != NodeTypeEnums.ObjectTypeNode ) {
            returnMask = source.updateMask( declaredMask.clone().setAll( mask ) );
        } else { // else ObjectTypeNode
            returnMask = declaredMask.clone().setAll( mask );
        }
View Full Code Here

Examples of org.drools.core.util.bitmask.BitMask

                calculateMask(analyzedCondition, settableProperties) :
                calculateMaskFromExpression(settableProperties);
    }

    private BitMask calculateMaskFromExpression(List<String> settableProperties) {
        BitMask mask = getEmptyPropertyReactiveMask(settableProperties.size());
        String[] simpleExpressions = expression.split("\\Q&&\\E|\\Q||\\E");

        for (String simpleExpression : simpleExpressions) {
            String propertyName = getPropertyNameFromSimpleExpression(simpleExpression);
            if (propertyName.length() == 0) {
                continue;
            }
            if (propertyName.equals("this")) {
                return allSetButTraitBitMask();
            }
            int pos = settableProperties.indexOf(propertyName);
            if (pos < 0 && Character.isUpperCase(propertyName.charAt(0))) {
                propertyName = propertyName.substring(0, 1).toLowerCase() + propertyName.substring(1);
                pos = settableProperties.indexOf(propertyName);
            }
            if (pos >= 0) { // Ignore not settable properties
                mask = mask.set(pos + PropertySpecificUtil.CUSTOM_BITS_OFFSET);
            }
        }

        return mask;
    }
View Full Code Here

Examples of org.drools.core.util.bitmask.BitMask

    private BitMask calculateMask(Condition condition, List<String> settableProperties) {
        if (condition instanceof SingleCondition) {
            return calculateMask((SingleCondition) condition, settableProperties);
        }
        BitMask mask = getEmptyPropertyReactiveMask(settableProperties.size());;
        for (Condition c : ((CombinedCondition)condition).getConditions()) {
            String propertyName = getFirstInvokedPropertyName(((SingleCondition) c).getLeft());
            if (propertyName != null) {
                mask = setPropertyOnMask(mask, settableProperties, propertyName);
            }
View Full Code Here

Examples of org.drools.core.util.bitmask.BitMask

        if ( leftTuple != null && leftTuple.getLeftTupleSink().getLeftInputOtnId().equals( otnId ) ) {
            modifyPreviousTuples.removeLeftTuple();
            leftTuple.reAdd();
            LeftTupleSink sink = getSinkPropagator().getFirstLeftTupleSink();
            BitMask mask = sink.getLeftInferredMask();
            if ( context.getModificationMask().intersects( mask) ) {
                doUpdateObject( leftTuple, context, workingMemory, (LeftInputAdapterNode) leftTuple.getLeftTupleSink().getLeftTupleSource(), true, lm, lm.getSegmentMemory() );
                if (leftTuple instanceof Activation) {
                    ((Activation)leftTuple).setActive(true);
                }
            }
        } else {
            LeftTupleSink sink = getSinkPropagator().getFirstLeftTupleSink();
            BitMask mask = sink.getLeftInferredMask();
            if ( context.getModificationMask().intersects( mask) ) {
                doInsertObject(factHandle, context, this,
                               workingMemory,
                               lm, true, true);
            }
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.