1 | |
package org.kuali.rice.krms.framework.engine; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.List; |
5 | |
|
6 | |
import org.kuali.rice.krms.api.engine.EngineResults; |
7 | |
import org.kuali.rice.krms.api.engine.ResultEvent; |
8 | |
|
9 | 29 | public class EngineResultsImpl implements EngineResults { |
10 | 29 | private List<ResultEvent> results = new ArrayList<ResultEvent>(); |
11 | |
|
12 | |
@Override |
13 | |
public void addResult(ResultEvent result) { |
14 | 1389 | results.add(result); |
15 | 1389 | } |
16 | |
|
17 | |
@Override |
18 | |
public List<ResultEvent> getAllResults() { |
19 | 0 | return new ArrayList<ResultEvent>(results); |
20 | |
} |
21 | |
|
22 | |
@Override |
23 | |
public ResultEvent getResultEvent(int index) { |
24 | |
|
25 | 0 | return null; |
26 | |
} |
27 | |
|
28 | |
@Override |
29 | |
public List<ResultEvent> getResultsOfType(String type) { |
30 | |
|
31 | 0 | ArrayList<ResultEvent> newList = new ArrayList<ResultEvent>(); |
32 | 0 | if (type == null) return newList; |
33 | 0 | for (int i=0; i<results.size(); i++){ |
34 | 0 | if (type.equalsIgnoreCase(results.get(i).getType())){ |
35 | 0 | newList.add(results.get(i)); |
36 | |
} |
37 | |
} |
38 | 0 | return newList; |
39 | |
} |
40 | |
} |