@@ -0,0 +1,2109 @@
+/*%0A * Copyright (c) 2012 Mateusz Parzonka, Eric Bodden%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A *%0A * Contributors:%0A * Mateusz Parzonka - initial API and implementation%0A */%0Apackage prm4j.logic;%0A%0Aimport java.util.HashMap;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0Aimport java.util.Map.Entry;%0A%0Aimport prm4j.api.Parameter;%0Aimport prm4j.api.Symbol;%0Aimport prm4j.api.fsm.FSM;%0A%0Apublic class StatefulSpecConverter %7B%0A%0A    private final Map%3CSymbol, Set%3CSet%3CSymbol%3E%3E%3E propertyEnableSets;%0A    private final Map%3CSymbol, Set%3CSet%3CParameter%3C?%3E%3E%3E%3E parameterEnableSets;%0A    private final Map%3CMonitorState%3C?%3E, Set%3CSet%3CSymbol%3E%3E%3E stateCoEnableSets;%0A    private final MonitorState%3C?%3E initialState;%0A    private final List%3CSymbol%3E symbols;%0A%0A    public StatefulSpecConverter(StatefulSpec spec) %7B%0A%09propertyEnableSets = spec.getPropertyEnableSet();%0A%09parameterEnableSets = getParameterEnableSets(propertyEnableSets);%0A%09stateCoEnableSets = spec.getStateCoEnableSet();%0A%09initialState = spec.getInitialState();%0A%09symbols = spec.getSymbols();%0A    %7D%0A%0A    private static %3CA%3E Map%3CSymbol, Set%3CSet%3CParameter%3C?%3E%3E%3E%3E getParameterEnableSets(%0A%09    Map%3CSymbol, Set%3CSet%3CSymbol%3E%3E%3E symbol2setOfSetOfSymbol) %7B%0A%09Map%3CSymbol, Set%3CSet%3CParameter%3C?%3E%3E%3E%3E result = new HashMap%3CSymbol, Set%3CSet%3CParameter%3C?%3E%3E%3E%3E();%0A%09for (Entry%3CSymbol, Set%3CSet%3CSymbol%3E%3E%3E entry : symbol2setOfSetOfSymbol.entrySet()) %7B%0A%09    result.put(entry.getKey(), toParameterSets(entry.getValue()));%0A%09%7D%0A%09return result;%0A    %7D%0A%0A    private static Set%3CSet%3CParameter%3C?%3E%3E%3E toParameterSets(Set%3CSet%3CSymbol%3E%3E propertyEnableSet) %7B%0A%09Set%3CSet%3CParameter%3C?%3E%3E%3E result = new HashSet%3CSet%3CParameter%3C?%3E%3E%3E();%0A%09for (Set%3CSymbol%3E set : propertyEnableSet) %7B%0A%09    Set%3CParameter%3C?%3E%3E parameterSet = new HashSet%3CParameter%3C?%3E%3E();%0A%09    for (Symbol symbol : set) %7B%0A%09%09parameterSet.addAll(symbol.getParameters());%0A%09    %7D%0A%09    result.add(parameterSet);%0A%09%7D%0A%09return result;%0A    %7D%0A%0A%7D%0A

Add StatefulSpecConverter