⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 leftinputadapternode.java

📁 drools 一个开放源码的规则引擎
💻 JAVA
字号:
package org.drools.reteoo;

import org.drools.FactException;
import org.drools.spi.PropagationContext;

public class LeftInputAdapterNode extends TupleSource
    implements
    ObjectSink
{
    private final ObjectSource objectSource;
    
    private final int          column;

    public LeftInputAdapterNode(int id,
                                int column,
                                ObjectSource source)
    {
        super( id  );
        this.column = column;
        this.objectSource = source;
    }

    public void attach()
    {
        this.objectSource.addObjectSink( this );
    }

    public void assertObject(Object object,
                             FactHandleImpl handle,
                             PropagationContext context, 
                             WorkingMemoryImpl workingMemory) throws FactException
    {
        ReteTuple tuple = new ReteTuple( this.column ,
                                         handle,
                                         workingMemory );
        propagateAssertTuple( tuple,
                              context,
                              workingMemory );
    }

    public void retractObject(FactHandleImpl handle,
                              PropagationContext context, 
                              WorkingMemoryImpl workingMemory) throws FactException
    {
        TupleKey key = new TupleKey( this.column ,
                                     handle );
        propagateRetractTuples( key,
                                context,
                                workingMemory );
    }

    public int getId()
    {
        return id;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -