@@ -0,0 +1,2456 @@
+/* Copyright (C) 2013-2017 TU Dortmund%0A * This file is part of LearnLib, http://www.learnlib.de/.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage de.learnlib.oracle.membership;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Aimport de.learnlib.api.Mapper;%0Aimport de.learnlib.api.oracle.MembershipOracle;%0Aimport de.learnlib.api.query.DefaultQuery;%0Aimport de.learnlib.api.query.Query;%0A%0A/**%0A * A utility class that allows to lift a membership oracle of concrete input/output symbols to a membership oracle of%0A * abstract input/output symbols, given a corresponding mapper.%0A *%0A * @param %3CAI%3E%0A *         abstract input symbol type.%0A * @param %3CAO%3E%0A *         abstract output symbol type.%0A * @param %3CCI%3E%0A *         concrete input symbol type.%0A * @param %3CCO%3E%0A *         concrete output symbol type.%0A *%0A * @author frohme%0A */%0Apublic class MappedOracle%3CAI, AO, CI, CO%3E implements MembershipOracle%3CAI, AO%3E %7B%0A%0A    private final MembershipOracle%3CCI, CO%3E delegate;%0A%0A    private final Mapper%3CAI, AO, CI, CO%3E mapper;%0A%0A    public MappedOracle(MembershipOracle%3CCI, CO%3E delegate, Mapper%3CAI, AO, CI, CO%3E mapper) %7B%0A        this.delegate = delegate;%0A        this.mapper = mapper;%0A    %7D%0A%0A    @Override%0A    public void processQueries(Collection%3C? extends Query%3CAI, AO%3E%3E queries) %7B%0A        final List%3CQuery%3CAI, AO%3E%3E orderedQueries = new ArrayList%3C%3E(queries);%0A        final List%3CDefaultQuery%3CCI, CO%3E%3E mappedQueries = new ArrayList%3C%3E(queries.size());%0A%0A        for (final Query%3CAI, AO%3E q : orderedQueries) %7B%0A            mappedQueries.add(new DefaultQuery%3C%3E(q.getPrefix().transform(mapper::mapInput),%0A                                                 q.getSuffix().transform(mapper::mapInput)));%0A        %7D%0A%0A        this.delegate.processQueries(mappedQueries);%0A%0A        for (int i = 0; i %3C orderedQueries.size(); i++) %7B%0A            orderedQueries.get(i).answer(mapper.mapOutput(mappedQueries.get(i).getOutput()));%0A        %7D%0A    %7D%0A%7D%0A

add mapped oracle