@@ -0,0 +1,1812 @@
+/*%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.api.fsm;%0A%0Aimport prm4j.api.Alphabet;%0Aimport prm4j.api.MatchHandler;%0Aimport prm4j.api.Symbol;%0A%0A/**%0A * @param %3CA%3E%0A *            the type of the auxiliary data usable by base monitors%0A */%0Apublic class FSMState%3CL%3E %7B%0A%0A    private FSMState%3CL%3E%5B%5D successorTable;%0A    private final boolean isFinal;%0A    private final String label;// for display purposes only%0A    private final Alphabet alphabet;%0A    private final MatchHandler matchHandler;%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    public FSMState(Alphabet alphabet, boolean isFinal, MatchHandler matchHandler, String label) %7B%0A%09this.isFinal = isFinal;%0A%09this.label = label;%0A%09this.alphabet = alphabet;%0A%09this.matchHandler = matchHandler;%0A%09this.successorTable = new FSMState%5Balphabet.size()%5D;%0A    %7D%0A%0A    public void addTransition(Symbol symbol, FSMState%3CL%3E successor) %7B%0A%09assert this.successorTable%5Bsymbol.getIndex()%5D == null : %22successor already set%22;%0A%09if (!this.alphabet.getSymbols().contains(symbol)) %7B%0A%09    throw new IllegalArgumentException(%22Symbol for transition is not contained in alphabet!%22);%0A%09%7D%0A%09this.successorTable%5Bsymbol.getIndex()%5D = successor;%0A    %7D%0A%0A    public FSMState%3CL%3E getSuccessor(Symbol symbol) %7B%0A%09return this.successorTable%5Bsymbol.getIndex()%5D;%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A%09return this.label;%0A    %7D%0A%0A    public boolean isFinal() %7B%0A%09return this.isFinal;%0A    %7D%0A%0A    public MatchHandler getMatchHandler() %7B%0A%09return this.matchHandler;%0A    %7D%0A%0A%7D%0A

Add state for fsm