instrumentedcondition.java

来自「rule engine drools-2.0-beta-18」· Java 代码 · 共 50 行

JAVA
50
字号
package org.drools.spi;import java.util.HashSet;import java.util.Iterator;import java.util.Set;import org.drools.rule.Declaration;public class InstrumentedCondition implements Condition{    private Set     decls;    private boolean isAllowed;    public InstrumentedCondition()    {        this.decls = new HashSet( );    }    public Declaration[] getRequiredTupleMembers()    {        Declaration[] declArray = new Declaration[this.decls.size( )];        Iterator declIter = this.decls.iterator( );        int i = 0;        while ( declIter.hasNext( ) )        {            declArray[i++] = ( Declaration ) declIter.next( );        }        return declArray;    }    public void addDeclaration(Declaration decl)    {        this.decls.add( decl );    }    public void isAllowed(boolean isAllowed)    {        this.isAllowed = isAllowed;    }    public boolean isAllowed(Tuple tuple)    {        return this.isAllowed;    }}

⌨️ 快捷键说明

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