[1326] | 1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany |
---|
| 2 | // |
---|
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
---|
| 4 | // you may not use this file except in compliance with the License. |
---|
| 5 | // You may obtain a copy of the License at |
---|
| 6 | // |
---|
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
---|
| 8 | // |
---|
| 9 | // Unless required by applicable law or agreed to in writing, software |
---|
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
---|
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
| 12 | // See the License for the specific language governing permissions and |
---|
| 13 | // limitations under the License. |
---|
| 14 | |
---|
| 15 | package de.ugoe.cs.autoquest.plugin.usability2.rules.operator; |
---|
| 16 | |
---|
| 17 | import java.util.ArrayList; |
---|
| 18 | import java.util.Arrays; |
---|
| 19 | import java.util.Collections; |
---|
| 20 | import java.util.List; |
---|
| 21 | |
---|
| 22 | import de.ugoe.cs.autoquest.plugin.usability2.rules.results.IResult; |
---|
| 23 | import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; |
---|
| 24 | |
---|
| 25 | /** |
---|
| 26 | * <p> |
---|
| 27 | * TODO comment |
---|
| 28 | * </p> |
---|
| 29 | * |
---|
| 30 | * @author Konni Hartmann |
---|
| 31 | */ |
---|
| 32 | public abstract class AbstractFilterOperator implements IFilter { |
---|
| 33 | |
---|
| 34 | private final List<IFilter> filters; |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | public AbstractFilterOperator(List<IFilter> filters) { |
---|
| 38 | this.filters = Collections.unmodifiableList(new ArrayList<IFilter>(filters)); |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | public AbstractFilterOperator(IFilter... filters) { |
---|
| 42 | this(Arrays.asList(filters)); |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | public abstract IResult match(ITask task, List<IFilter> filters); |
---|
| 46 | |
---|
| 47 | @Override |
---|
| 48 | public IResult match(ITask task) { |
---|
| 49 | return match(task, filters); |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | } |
---|