Package org.drools.core.factmodel.traits

Examples of org.drools.core.factmodel.traits.TraitTypeMap


                        // however, PR must be disabled only once for each OTN: that is, a proxy will not pass an OTN if one of its ancestors can also pass it

                        // Example: given classes A <- B <-C, at OTN A, a proxy c can only pass if no proxy b exists

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

                        long originalMask = context.getModificationMask();
                        if ( ! k.isTop() ) {
                            context.setModificationMask( -1L );
View Full Code Here


                        // however, PR must be disabled only once for each OTN: that is, a proxy will not pass an OTN if one of its ancestors can also pass it

                        // Example: given classes A <- B <-C, at OTN A, a proxy c can only pass if no proxy b exists

                        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() );
View Full Code Here

        return firstThing;
    }

    private void checkStaticTypeCode( TraitableBean inner ) {
        if ( ! inner.hasTraits() ) {
            TraitTypeMap ttm = (TraitTypeMap) inner._getTraitMap();
            if ( ttm != null && ttm.getStaticTypeCode() == null ) {
                TraitRegistry registry = this.workingMemory.getKnowledgeBase().getConfiguration().getComponentFactory().getTraitRegistry();
                // code that summarizes ALL the static types
                BitSet staticCode = registry.getStaticTypeCode( inner.getClass().getName() );
                ttm.setStaticTypeCode( staticCode );
                if ( staticCode != null ) {
                    for ( String staticTrait : registry.getStaticTypes( inner.getClass().getName() ) ) {
                        ttm.addStaticTrait( staticTrait, registry.getHierarchy().getCode( staticTrait ) );
                    }
                }
            }
        }
    }
View Full Code Here

                        // however, PR must be disabled only once for each OTN: that is, a proxy will not pass an OTN if one of its ancestors can also pass it

                        // Example: given classes A <- B <-C, at OTN A, a proxy c can only pass if no proxy b exists

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

                        long originalMask = context.getModificationMask();
                        if ( ! k.isTop() ) {
                            context.setModificationMask( -1L );
View Full Code Here

        return firstThing;
    }

    private void checkStaticTypeCode( TraitableBean inner ) {
        if ( ! inner.hasTraits() ) {
            TraitTypeMap ttm = (TraitTypeMap) inner._getTraitMap();
            if ( ttm != null && ttm.getStaticTypeCode() == null ) {
                TraitRegistry registry = this.workingMemory.getKnowledgeBase().getConfiguration().getComponentFactory().getTraitRegistry();
                // code that summarizes ALL the static types
                BitSet staticCode = registry.getStaticTypeCode( inner.getClass().getName() );
                ttm.setStaticTypeCode( staticCode );
                if ( staticCode != null ) {
                    for ( String staticTrait : registry.getStaticTypes( inner.getClass().getName() ) ) {
                        ttm.addStaticTrait( staticTrait, registry.getHierarchy().getCode( staticTrait ) );
                    }
                }
            }
        }
    }
View Full Code Here

        if ( _getTraitMap() == null ) { return Collections.EMPTY_LIST; }
        return ((TraitTypeMap) _getTraitMap()).getMostSpecificTraits();
    }

    public BitSet getCurrentTypeCode() {
        TraitTypeMap map = ((TraitTypeMap) _getTraitMap());
        return map != null ? map.getCurrentTypeCode() : null;
    }
View Full Code Here

                        // however, PR must be disabled only once for each OTN: that is, a proxy will not pass an OTN if one of its ancestors can also pass it

                        // Example: given classes A <- B <-C, at OTN A, a proxy c can only pass if no proxy b exists

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

                        long originalMask = context.getModificationMask();
                        if ( ! k.isTop() ) {
                            context.setModificationMask( -1L );
View Full Code Here

        if ( obj._getDynamicProperties() == null ) {
            obj._setDynamicProperties( m );
        }

        if ( obj._getTraitMap() == null ) {
            obj._setTraitMap( new TraitTypeMap( new HashMap() ) );
        }
    }
View Full Code Here

        if ( obj._getDynamicProperties() == null ) {
            obj._setDynamicProperties(m);
        }

        if ( obj._getTraitMap() == null ) {
            obj._setTraitMap(new TraitTypeMap(new HashMap()));
        }
    }
View Full Code Here

        if ( obj._getDynamicProperties() == null ) {
            obj._setDynamicProperties(new TripleBasedBean(obj, m, factory));
        }

        if ( obj._getTraitMap() == null ) {
            obj._setTraitMap(new TraitTypeMap(new TripleBasedTypes(obj, m, factory)));
        }

    }
View Full Code Here

TOP

Related Classes of org.drools.core.factmodel.traits.TraitTypeMap

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.