001/* Copyright (C) 2013 TU Dortmund
002 * This file is part of AutomataLib, http://www.automatalib.net/.
003 * 
004 * AutomataLib is free software; you can redistribute it and/or
005 * modify it under the terms of the GNU Lesser General Public
006 * License version 3.0 as published by the Free Software Foundation.
007 * 
008 * AutomataLib is distributed in the hope that it will be useful,
009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
011 * Lesser General Public License for more details.
012 * 
013 * You should have received a copy of the GNU Lesser General Public
014 * License along with AutomataLib; if not, see
015 * http://www.gnu.de/documents/lgpl.en.html.
016 */
017package net.automatalib.automata.transout.impl;
018
019/**
020 * A transition a mealy machine, comprising a successor state
021 * and an output symbol.
022 * 
023 * @author Malte Isberner <malte.isberner@cs.uni-dortmund.de>
024 *
025 * @param <S> state class.
026 * @param <O> output symbol class.
027 */
028public class MealyTransition<S, O> {
029        private final S successor;
030        private O output;
031        
032        
033        /**
034         * Constructor.
035         * @param successor successor state.
036         * @param output output symbol.
037         */
038        public MealyTransition(S successor, O output) {
039                this.successor = successor;
040                this.output = output;
041        }
042
043
044        /**
045         * Retrieves the output symbol.
046         * @return the output symbol.
047         */
048        public O getOutput() {
049                return output;
050        }
051
052
053        /**
054         * Sets the output symbol.
055         * @param output the new output symbol.
056         */
057        public void setOutput(O output) {
058                this.output = output;
059        }
060
061
062        /**
063         * Retrieves the successor state.
064         * @return the successor state.
065         */
066        public S getSuccessor() {
067                return successor;
068        }
069}