1
2 package org.drools.spi;
3
4 import org.drools.rule.Declaration;
5
6 import java.util.Set;
7 import java.util.HashSet;
8 import java.util.Iterator;
9
10 public class InstrumentedCondition implements Condition
11 {
12 private Set decls;
13 private boolean isAllowed;
14
15 public InstrumentedCondition()
16 {
17 this.decls = new HashSet();
18 }
19
20 public Declaration[] getRequiredTupleMembers()
21 {
22 Declaration[] declArray = new Declaration[ this.decls.size() ];
23
24 Iterator declIter = this.decls.iterator();
25
26 int i = 0;
27
28 while ( declIter.hasNext() )
29 {
30 declArray[i++] = (Declaration) declIter.next();
31 }
32
33 return declArray;
34 }
35
36 public void addDeclaration(Declaration decl)
37 {
38 this.decls.add( decl );
39 }
40
41 public void isAllowed(boolean isAllowed)
42 {
43 this.isAllowed = isAllowed;
44 }
45
46 public boolean isAllowed(Tuple tuple)
47 {
48 return this.isAllowed;
49 }
50 }
This page was automatically generated by Maven