Examples of BitMask


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

    public PropagationContext adaptModificationMaskForObjectType(ObjectType type, InternalWorkingMemory workingMemory) {
        if (isAllSetPropertyReactiveMask(originalMask) || originalMask.isSet(PropertySpecificUtil.TRAITABLE_BIT) || !(type instanceof ClassObjectType)) {
            return this;
        }
        ClassObjectType classObjectType = (ClassObjectType)type;
        BitMask cachedMask = classObjectType.getTransformedMask(modifiedClass, originalMask);

        if (cachedMask != null) {
            return this;
        }
View Full Code Here

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

    private static BitMask calculatePatternMask(List<String> listenedProperties, List<String> settableProperties, boolean isPositive) {
        if (listenedProperties == null) {
            return EmptyBitMask.get();
        }

        BitMask mask = getEmptyPropertyReactiveMask(settableProperties.size());
        if (listenedProperties != null && listenedProperties.contains( TraitableBean.TRAITSET_FIELD_NAME )) {
            if (isPositive && listenedProperties != null && listenedProperties.contains( TraitableBean.TRAITSET_FIELD_NAME ) ) {
                mask = mask.set(TRAITABLE_BIT);
            }
        }
        for (String propertyName : listenedProperties) {
            if (propertyName.equals(isPositive ? "*" : "!*")) {
                return isPositive ? AllSetBitMask.get() : allSetButTraitBitMask();
View Full Code Here

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

            }
        }
        if (settableProperties == null || !(constraint instanceof MvelConstraint)) {
            return typeBit ? AllSetBitMask.get() : allSetButTraitBitMask();
        }
        BitMask mask = ((MvelConstraint)constraint).getListenedPropertyMask(settableProperties);
        return typeBit ? mask.set(PropertySpecificUtil.TRAITABLE_BIT) : mask;
    }
View Full Code Here

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

    public BetaConstraints getOriginalConstraint() {
        throw new UnsupportedOperationException();
    }

    public BitMask getListenedPropertyMask(List<String> settableProperties) {
        BitMask mask = getEmptyPropertyReactiveMask(settableProperties.size());
        for (BetaNodeFieldConstraint constraint : constraints) {
            if (constraint instanceof MvelConstraint) {
                mask = mask.setAll(((MvelConstraint)constraint).getListenedPropertyMask(settableProperties));
            } else {
                return allSetButTraitBitMask();
            }
        }
        return mask;
View Full Code Here

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

    public PropagationContext adaptModificationMaskForObjectType(ObjectType type, InternalWorkingMemory workingMemory) {
        if (isAllSetPropertyReactiveMask(originalMask) || originalMask.isSet(PropertySpecificUtil.TRAITABLE_BIT) || !(type instanceof ClassObjectType)) {
            return this;
        }
        ClassObjectType classObjectType = (ClassObjectType)type;
        BitMask cachedMask = classObjectType.getTransformedMask(modifiedClass, originalMask);

        if (cachedMask != null) {
            return this;
        }
View Full Code Here

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

                        TraitableBean txBean = (TraitableBean) proxy.getObject();
                        TraitTypeMap tMap = (TraitTypeMap) txBean._getTraitMap();
                        Collection<Thing> x = tMap.immediateParents( this.typeMask );
                        Thing k = x.iterator().next();

                        BitMask originalMask = context.getModificationMask();
                        if ( ! k.isTop() ) {
                            context.setModificationMask( AllSetBitMask.get() );
                        }
                        //System.out.println(" MODIFY PASS !! " + factHandle.getObject() + " " + ( (TraitProxy) factHandle.getObject() ).getTypeCode() + " >> " + vetoMask + " checks in " + typeMask );
                        this.sink.propagateModifyObject( factHandle,
View Full Code Here

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

        return true;
    }

    @Override
    public BitMask updateMask(BitMask mask) {
        BitMask returnMask;
        returnMask = declaredMask.clone().setAll( mask );
        inferredMask = inferredMask.setAll( returnMask );
        return returnMask;
    }
View Full Code Here

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

        ConsequenceMetaData.Statement statement = null;
        if (typeDeclaration != null) {
            statement = new ConsequenceMetaData.Statement(ConsequenceMetaData.Statement.Type.MODIFY, typeClass);
            context.getRule().getConsequenceMetaData().addStatement(statement);
        }
        BitMask modificationMask = isPropertyReactive ? getEmptyPropertyReactiveMask(settableProperties.size()) : allSetButTraitBitMask();

        int end = originalBlock.indexOf("{");
        if (end == -1) {
            // no block
            context.addError(new DescrBuildError(context.getParentDescr(),
View Full Code Here

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

                                            JavaBlockDescr d,
                                            String originalBlock,
                                            StringBuilder consequence,
                                            Declaration declr,
                                            String obj) {
        BitMask modificationMask = AllSetBitMask.get();

        Class<?> typeClass = findModifiedClass(context, d, declr);
        TypeDeclaration typeDeclaration = typeClass == null ? null : context.getKnowledgeBuilder().getTypeDeclaration(typeClass);

        if (typeDeclaration != null) {
View Full Code Here

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

    private <T> void updateCore( TraitableBean inner, Object core, Class<T> trait, boolean logical ) {
        FactHandle handle = lookupFactHandle( inner );
        InternalFactHandle h = (InternalFactHandle) handle;
        if ( handle != null ) {
            TraitFieldTMS fieldTMS = inner._getFieldTMS();
            BitMask mask = fieldTMS == null ? onlyTraitBitSetMask() : fieldTMS.getModificationMask();
            ((NamedEntryPoint) h.getEntryPoint()).update( h,
                                                          h.getEqualityKey() != null && h.getEqualityKey().getStatus() == EqualityKey.JUSTIFIED,
                                                          ((InternalFactHandle)handle).getObject(),
                                                          mask,
                                                          core.getClass(),
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.