source: trunk/autoquest-plugin-usability2/src/main/java/de/ugoe/cs/autoquest/plugin/usability2/rules/operator/transformer/CurrentTaskAsResultTransformer.java @ 1326

Last change on this file since 1326 was 1326, checked in by khartmann, 10 years ago

Moved alexanders code into a new plugin project.
First commit of my experimental code (needs a lot of cleanup).

File size: 1.2 KB
Line 
1package de.ugoe.cs.autoquest.plugin.usability2.rules.operator.transformer;
2
3import de.ugoe.cs.autoquest.plugin.usability2.rules.operator.IFilter;
4import de.ugoe.cs.autoquest.plugin.usability2.rules.operator.IResultTransformer;
5import de.ugoe.cs.autoquest.plugin.usability2.rules.results.DefaultMatch;
6import de.ugoe.cs.autoquest.plugin.usability2.rules.results.IMatch;
7import de.ugoe.cs.autoquest.plugin.usability2.rules.results.IResult;
8import de.ugoe.cs.autoquest.plugin.usability2.rules.results.TransformedResult;
9import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
10
11public class CurrentTaskAsResultTransformer implements IResultTransformer {
12
13    public static final IResultTransformer CURRENT_TASK_AS_RESULT_TRANSFORMER = new CurrentTaskAsResultTransformer();
14   
15    private CurrentTaskAsResultTransformer(){
16        super();
17    }
18   
19    @Override
20    public IResult transform(IResult result, IFilter filter, final ITask task) {
21        return new TransformedResult(result) {
22           
23            @Override
24            protected IMatch transform(IMatch next) {
25                return new DefaultMatch(task, next.getLabeledResults());
26            }
27        };
28    }
29
30}
Note: See TracBrowser for help on using the repository browser.